Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Local WordPress Development Local WordPress Development Migrating WordPress from Local to Live Server

Daniel Oropeza
Daniel Oropeza
4,432 Points

Please help? I get redirected to the localhost when I enter the live site url?

I am lost..

Daniel Oropeza
Daniel Oropeza
4,432 Points

sigh maybe I'll just delete everything and try again tomorrow when I have the patience.

4 Answers

Austin Whipple
Austin Whipple
29,725 Points

Could be a couple things:

  1. You've changed the entry in your computer's hosts file. Read more.
  2. There are some values in your WordPress site's database that redirect you once you've logged in. Read more.
David Wood
David Wood
5,705 Points

It would be helpful to see what you have and to know a little more about what you have done.

Daniel Oropeza
Daniel Oropeza
4,432 Points

Ok a few details...

So it looks like when I try to access mylivewebsite.com, it redirects me to localhost. It is also using the Xampp server to load the website.

When I try to access mylivewebsite.com/wp-admin, everything works out great. I can get to my login page, I can access the admin page, and it's all being uploaded from my web server (NOT Xampp)

I have checked the wpconfig file and everything looks in order. Only thing that concerns me is that the host names are both 'localhost' for the local site as well as the live site. But I'm not sure that's even an issue.

I will now check my theme files to see if I wrote any code that is redirecting me to localhost/mywebsite.com

Thanks for the input guys, if you have any ideas as to what may be wrong please let me know!

Austin Whipple
Austin Whipple
29,725 Points

Yeah, sounding like there might be some value in your WordPress database causing the site to redirect. Some more information about moving a WP site here: https://wordpress.org/support/topic/remote-site-redirects-to-localhost

Daniel Oropeza
Daniel Oropeza
4,432 Points

Yeah the whole site is up, I just have to access it through another link that is not mywebsite.com

Thankfully my homepage is a category page so I just go to mywebsite.com/category

I'm not getting the site up yet, I just wanted to show it to someone. I'll figure this out once I'm ready to transfer it to the real domain.

Thank you :)