Knowledgebase: Domains
How to test your site before moving DNS
Posted by Aaron Eaton on 28 May 2015 11:29 AM

Editing Local "hosts" File
This is the preferred method to test your site if you are using Apache mod_rewrite rules. This method is a bit more in-depth and requires some working knowledge of your operating system. I will attempt to break it down as much as possible.

  1. Locate the HOSTS file on your computers. Typically it is in one of the following locations:
    • Windows NT/2000/XP/2003/Vista/7 - C:\windows\system32\drivers\etc\hosts
    • Windows 95/98/Me - C:\windows\hosts
  2. Open this file with a text editor such as Notepad or Wordpad.
    • Right-click on Notepad and select the option to Run as Administrator - otherwise you may not be able to open this file.
  3. Then, open the file. Consider performing a "Save As" so you have an original copy of the file that you can restore later. You will see two columns of information, the first containing IP addresses and the second containing host names. By default, a windows hosts file should be similar to the following
    Code: localhost
    • You can add additional lines to this file that will point requests for a particular domain to your new server's IP address. Example:
      Code: localhost
  1. Save your changes.
  2. Restart any currently open browsers. You may also want to flush your DNS cache. In Windows XP, go to Start, and then Run, then type "cmd" and hit enter. Type the following:
    ipconfig /flushdns
  3. Visit your new site using or
(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).