|
Previewing Your Web Site
How to preview your website using your 'hosts' fileNew and transferred domain names have a propagation period that can be anywhere from a few hours to a few days. During this period of time the new or transferred domain information propagates around the internet, and you can't see your new webspace. Top Tip from 2020Media If you need to preview your site immediately you can edit a file on your computer as a temporary work around. Use your Hosts fileWindows contains a file called 'hosts' that will enable resolution of your domain name to the web server. Carefully edit this file using the following procedure. 1. Locate the hosts file on your computer
Navigate to the following directory using Windows explorer or similar:
Apple Macintosh: Mac OS X and newer: /etc/hosts
Note in Windows 7 and above, you must open this with Notepad run as Administrator. To do this, click Start, click All Programs, click Accessories, right-click Notepad, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow or Yes. 2. Open the hosts file for editing Start a new line at the bottom of the file. To do so, click your mouse so that the cursor is at the very end of the last line and hit enter to start a new line. Enter the following two lines of text like this example: 123.123.123.123 yourdomainname.com
Close the Hosts file and save it when asked. If your web browser is currently open, close it so that the changes take effect. It is not necessary to restart your computer.
In the example, after saving the file, your browser will be automatically directed to the '123.123.123.123' IP address when navigating to either ‘http://yourdomain.com’ or ‘http://www.yourdomain.com’ .
Once you’re done working on the development or test sites, you’ll need to remember to remove the entries from the hosts file and save it in order to access the live sites again.
|