最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Links redirecting to localhost after migration to server

programmeradmin0浏览0评论

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 ''. Both 'home' and 'siteurl' should be the same. That did the trick and all my links now work.

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.

Share Improve this question edited Jun 9, 2014 at 1:57 vonnie asked Jun 9, 2014 at 1:21 vonnievonnie 431 gold badge1 silver badge4 bronze badges 2
  • 1 You should add your solution as an answer. – Pieter Goosen Commented Jun 9, 2014 at 4:11
  • possible duplicate of Duplicate domain database to local - How? – Pieter Goosen Commented Jun 9, 2014 at 5:33
Add a comment  | 

2 Answers 2

Reset to default 5

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'.

Just re-write your answer in the answer field so that people see this thread as answered. Did many research and finally found a thing that works.

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.

发布评论

评论列表(0)

  1. 暂无评论