Using a hosts File When Moving a Store

If you will be moving a store and you want to continue using the same domain name, you will probably run into a timing issue when you are ready to test the new store. Since the domain name still points to the IP address of the old store, you cannot also use it to point to the new store while you are testing it. You can obtain a temporary .auth file for the new store that uses the IP address instead of the domain name, but there is an easier solution.

When you type a URL or domain name into your browser, the browser looks in a couple of places to translate that URL into an IP address. Your ISP maintains one or more DNS (Domain Name Service) servers that your browser uses for most URLs. However, you can override the information from the DNS servers by creating a hosts file on your own computer.

A hosts file is a simple text file that contains one line for each IP address that you want to define. Each line contains an IP address, some white space, and the URL that will be used for that IP address. For example, here is a sample line for shopsite.com:

207.126.116.65     shopsite.com

If you had that entry in a hosts file on your computer, whenever you told your browser to go to shopsite.com it would go to 207.126.116.55, regardless of the real IP address for that site. All URLs that are relative to the domain name are also controlled by the entry in the hosts file.

The only tricky thing about a hosts file is the location of the file on your PC. On Windows systems, the file must be in the c:\windows directory. On some Linux systems, it must be in the /etc directory. If the file is not in the correct directory, your browser will not find it to use the information.

Here are the steps for using a hosts file for testing a new ShopSite store:

  1. Obtain the IP address of your new store from your ShopSite Hosting Partner.
  2. Once you have that address, use a text editor to create a file with a line for your store, such as:

    201.123.456.78     mystore.com

  3. Save the file with the name "hosts" in the correct directory. Do not put any extension on the file name.
  4. Assuming that you've Published your new store, use your browser to go to your store, such as www.mystore.com. You should see the new store, not your existing store.
  5. After your new store is open to the public and the domain name points to the IP address of the new store, simply delete the hosts file or remove the line for your store.

ShopSite Help and Resource Center
April 3, 2003
Give Feedback

© 2007, ShopSite, Inc.
ShopSite Shopping Cart Software