Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,687 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,687 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 :)