0

I migrated my site from localhost (LAMP) to Namecheap and it is broken in that the images it is supposed to load from /wp-content return a 404 error.

I can login to wp-admin and I can see the pages which load menus and text correctly. But I can't seem to get the images to load, I have tried:

  • flushing permalinks
  • some .htaccess and wp-config changes

For example: The logo does not load when you're on the /about page:

https://example.com/site_dir/about

If you go to the wp-content folder the image is there but the site is not looking for it in the right directory (wp-content is in a subdirectory):

https://example.com/site_dir/wp-content/uploads/2018/05/site_dir_logo_light_textfull.png

Any help is very much appreciated!

2
  • i can recommend this tool. be carefull to read the manual on how it exactly works, since it will manipulate your database and overwrite some contents..
    – honk31
    Commented Jul 25, 2018 at 11:01
  • "not looking for it in the right directory" - Specifically, your site is looking for the image in the document root. ie. the URL is formatted: /wp-content/uploads/2018/05/entiere_logo_light_textfull.png
    – MrWhite
    Commented Jul 27, 2018 at 21:50

2 Answers 2

1

It looks like your localhost site had WordPress installed in the root directory but your production site is in a sub-directory.

You should review the instructions in the the WordPress Codex for Moving WordPress to see if you missed any steps. It describes both moving a WordPress installation from one server to another, and moving it from one directory to another. It seems like you did both, so all those instructions would apply.

0

So @juggler and @mrwhite were both correct.

Following the instructions to move wordpress into a subfolder would have worked. The problem had to do with the fact that I set up virtual hosts on my localhost machine, because I had multiple wordpress installs in the /var/www/html directory.

So I installed the migrated site in the root folder and it now works. I also had to enable mod_c rewrite rules for apache so that it would show write correctly to my .htaccess file. And I had to edit the site sitename and URL in the database wp-options table.

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.