How to redirect my wordpress website to localhost usin XAMPP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to redirect my wordpress website to localhost usin XAMPP

Postby CarlosLeon » 01. February 2017 01:14

Hi there,

I'm very, very new in all of this. I'm building my website with WordPress and I have it hosted on my computer with XAMPP. The problem has been when I've tried to upload the site to the SiteGround server. Following some instructions on Youtube I've changed the URLs On the Settings->General screen WordPress:
The "Site Address (URL)"
The "WordPress Address (URL)"

At first, it was pointing to localhost and I've changed it with siteground.com
Now I can't get inside my WordPress website and I don't know how to change the URL to point again to localhost and to have access to my site and be able to upload to the server. I suppose there is a way through the XAMPP control panel to do this but I don't find it. Can anybody help me with this issue? I don't know anything about coding HTLM or CSS or any other code. Is there an easy method to do it?
Please, I need help,
Thank you very much!
I really appreciate any help to recover my website.
Regards.
Carlos L.
CarlosLeon
 
Posts: 1
Joined: 01. February 2017 00:50
XAMPP version: 3.2.2
Operating System: windows 10

Re: How to redirect my wordpress website to localhost usin X

Postby Nobbie » 01. February 2017 12:20

CarlosLeon wrote:I suppose there is a way through the XAMPP control panel to do this but I don't find i


No way, that is not a Xampp issue and cannot solved with Xampp. You definately destroyed your WordPress installation, did you backup the whole thing before doing such critical things? (No - am i right?). It is worst idea in the world to edit the core of a sophisticated product without the slightest knowledge and without any backups. This is pure suicide.

Fortunately, i think i can give a fix how to get around this horrible problem. There is a good chance by manipulating the Windows hosts file. You ever heard of the hosts file? See https://en.wikipedia.org/wiki/Hosts_(file) for detailed information.

For Windows 10, the hosts file is located in c:\WIndows\System32\drivers\etc\hosts. Edit this file with an editor (i.e. Notepad), you have to start the editor as Administrator (right click onto the icon and choose "Start as Administrator..." or similar). If you do not run that as Administrator, you are not allowed to safe the file.

When you have opened the file, you must insert a line, this line must contain the domain name of your remote Server on siteground.com, as you did not tell us your domain, i will freely assume www.myserver.com (replace this with the appropriate name). You have to insert the following line into the hosts file (it does not matter where):

Code: Select all
127.0.0.1     www.myserver.com


Of course do NOT insert www.myserver.com, instead use the domain of your personal Server. Only the domain name, NO http: in front and no slashes or folders appended. Safe the hosts file. After you safed your file, you IMMEDIATELY can enter http://www.myserver.com into your browser in order to access YOUR LOCAL XAMPP INSTALLATION (i.e. also the WordPress installation, i dont know where you put the WordPress installation, but if you used a subfolder like "wordpress" or "wp", of course you have to append it like http://www.myserver.com/wordpress or http://www.myserver.com/wp). You dont need to restart Apache.

if you have success, undo the whole thing and re-insert localhost whereever it has been. Finally close WordPress and last not least edit your hosts file again and delete that line. Otherwise you cannot reach your remote Server from this PC, as on this PC http://www.myserver.com points to your localhost instead of the internet server, as long as you have that modified hosts file.

Last not least DO BACKUPS!!
Nobbie
 
Posts: 9569
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: chuckluttor, Linomendez and 44 guests