This is a pretty common problem, so I think it deserves a thorough answer that covers the situation most are probably Googling when they find this.
For Montrealist's Specific Issue
For the specific question, it looks like @montrealist improperly ran a database find/replace process at some point. I see the URL for the media is:
http://www.cosworth-europe/sam/wp-content/...
I'm guessing that this should be:
http://www.cosworth-europe.co.uk/sam/wp-content/...
At some point, you lost the host TLD, so that's the first thing that would be worth looking at here. You could re-run a find and replace with something like this:
- Find:
//www.cosworth-europe/
- Replace:
//www.cosworth-europe.co.uk/
This should correct the specific issue I see here, assuming that my assumptions are correct here.
For Those Googling Similar Issues
WordPress stores many references to URL's inside of its database. There's no single source config for a site's host, so you'll need to run a database find and replace the process to fix this. Depending on where those images are used, you may need to make sure that serialized strings are properly replaced as well.
For most cases, I'd recommend this as the best fix:
- Install the Better Search Replace plugin
- Find and replace your domain excluding the protocol, so find
//www.olddomain.com
with //www.newdomain.com
- Test and confirm that there are no issues, then uninstall and remove the plugin
I don't typically recommend plugins as solutions, I code most everything minimally myself but for this specific case, I'd personally use the WP Migrate DB Pro plugin for this and other database related transfers. The Better Search and Replace plugin is developed by the same company, Delicious Brains, and it provides the exact same find and replace process. It's a great option for thoroughly solving this problem.
If you do encounter issues, and you're unable to login to WordPress you can (S)FTP into your installs directory and set or update the following constants in your wp-config.php
file:
define( 'WP_HOME', 'https://www.example.com' );
define( 'WP_SITEURL', 'https://www.example.com' );
This should only be done temporarily though, once you correct the issue in the database it's best to remove this from your wp-config.php
file afterward.
Changing The Site URL
domain.com
withcosworth-europe.co.uk
right? That will replace the string without updating the serialized data. You should use a plugin such as Better Search Replace if you want to replace serialized data.