Links redirecting to localhost after migration to server

I developed a website on my localhost and migrated it to my web server. The site displays mostly everything on the home page (I lost some font settings as far as I can tell) and all the content seems to be intact as well as the menu items. But all links, images and nav items redirect to my localhost site. Even when I try to log into my wp-admin it accepts the credentials but redirects me to the admin for my localhost site. Is this my permalinks all messed up or something else? I have tried:

  • searching for an .htaccess file but there is none
  • defining a home & siteURL in the wp-config file (this just breaks the layout of the site although it still is active)
  • edited wp-options table to be new URL for ‘siteURL’ but couldn’t see a row for ‘home’

RESOLVED

I found the ‘home’ field. And that proved to be the clincher. So if anyone comes across this same issue, I resolved it by editing both the ‘home’ and ‘siteURL’ fields in the wp-options table of the database on the server (not the localhost one) to replace the ‘localhost/sitename’ with ‘http://www.sitename’. Both ‘home’ and ‘siteurl’ should be the same. That did the trick and all my links now work.

2 Answers
2

if anyone comes across with this issue, I resolved it by editing both the ‘home’ and ‘siteURL’ fields in the wp-options table of the database on the server (not the localhost one) to replace the ‘localhost/wordpress’ with ‘http://www.youehostedsitename’. replace Both ‘home’ and ‘siteurl’.

Leave a Comment