0

Never encountered this issue before. So I've just moved a site for a client to another server and for some reason all images give me a 404 when I change the default domain in the database (siteurl and home). CSS, JS and other files are linked correctly - it seems there's something affecting the uploads folder but I can't pinpoint what it is. Any ideas?

1
  • I am having the same issue of short, I have just cloned a wp website and in the clone there are just a handful of images that work. All the others appear as broken images in the front-end. When you try to check the gallery almost all images appear blank. When you try to view the image using it's link example.com/wp-content/uploads/folder/folder/image.jpg you get an error 404 Not Found but the image is actually there according to the ftp. So someone must be wrong the FTP or the browser.
    – JohnnyD
    Commented May 30, 2019 at 10:29

3 Answers 3

2

You will want to run a find-and-replace script across the database to update all URLs to reflect the new domain. Just because you change the WordPress settings doesn't mean the content stored in the database has been updated with the new domain! I've had good luck with the Velvet Blues Update URLs plugin but you can also do this type of find and replace update using phpMyAdmin or other similar database tools.

0

You must update the URLs in the database. Here is a tool that you can use https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

You can download it, unzip and upload it to your server where you have to replace URLs and then you can run it.

It's pretty simple. You have to enter old and new base URLs. You can also perform a dry run, check the changes and then go for live run.

0

Of course you can do as per some other people gave you to go through the Database and fix it. But it can also break it if not done properly.

Before going into Database mode, I would suggest one thing that happened to me.

First make sure that you go in the settings of WordPress and make sure that the URLs are good... EVEN if they are good SAVE SETTINGS once more to make sure the settings is reflected everywhere.

By using plugins to move sites around those settings don't seems to reflect everywhere even if this information here is good.

Also I would suggest to go through most of your Settings (For example Permalinks) and Plugin Settings (For Example Polylang I had a problem with it since there is PATH information in it) and see if there is any relations with "PATH" if there is make sure they have the good information and SAVE THEM AGAIN even if they have the proper information.

Sometime to make sure the change takes effect... I put a wrong information save and add the proper information again and save again... The reason why I do that, I know some programmers that do no "save" the information if it was the same before and after editing this way your are sure the information is transferred properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.