Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : I think AMMPS has my real website confused with my localhost



Threaded Mode | Print  

 I think AMMPS has my real website confused with my localhost (1 Replies, Read 3025 times)
nativedesign
Group: Member
Post Group: Newbie
Posts: 7
Status:
I cannot open my website after using AMMPS. I can only see it if I run AMMPS then open it, but its not the live site, its like AMPPS has two versions of my website running locally or something. one with localhost, and one without.
IP: --   

I think AMMPS has my real website confused with my localhost
cspeegle
Group: Member
Post Group: Newbie
Posts: 3
Status:
When you made the domain in your AMPPS setup, did you tick the box that said "Add an entry to host file"? If so, AMPPS wrote an entry into a special file on your computer that has to do with how your computer accesses the Internet, called a "host file." This file can be used to redirect websites to access at domain at a different IP address than is listed on public DNS servers - in your case, it redirects "yourwebsite.com" from its global IP address on the internet to 127.0.0.1, which is the internal IP address for your localhost. This is how AMPPS allows you to access your website via "yourwebsite.com" even though the website is on your computer and not a web server.

In order to get your live website back, you will have to edit your operating system's host file. On a Windows machine, this can be found by opening Notepad as an administrator (go to the search bar, type "Notepad", right-click on Notepad, select "Run as Administrator", and enter your password if prompted). Bring up the Open dialog for opening files and navigate to this location in the file structure:

c:\Windows\System32\Drivers\etc

Once in that directory, open the file called "hosts" - it doesn't have an extension. Somewhere in that file will be a line that reads like this:

127.0.0.1      yourdomain.com

delete that line and save the hosts file. You should now be able to visit your live website at yourdomain.com, like usual. If you prefer to keep the line and just deactivate it (so you can switch back to using AMPPS for your website with ease), instead put a hashtag (#) in front of the line so it reads

#127.0.0.1    yourdomain.com


and then, when you want to switch back to AMPPS, just open this file as an Administrator again and remove the hashtag.

If you are on a Mac or Linux machine, the process is much simpler. Open Terminal, first of all. If you have a favorite Terminal text editor, use that. I personally use nano because it's clean and simple to use, but you may have a different editor installed, such as gedit, vi, vim, etc. In the terminal, type this, replacing "nano" with your text editor of choice:

sudo nano /etc/hosts

Enter your password for superuser privileges and then go to the line that reads:

127.0.0.1    yourdomain.com

and either delete the line or put a hashtag in front, as above:

#127.0.0.1    yourdomain.com

Save the file (if on Nano, hit Ctrl+O, press Enter, then close out by hitting Ctrl+X; if on Vim, type:

:wq

and hit Enter). After this, you should be able to access the live version of your site.

Unless you have hard-coded links in your website, I would recommend that you use a different domain for testing than you use for production. This ensures that you will not have interference of this type in the future.
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 28, 2024, 7:29 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.019