Edit local hosts file

To view a website without using the temporary URL that has been setup for a new site or a site that has moved from one of our servers to another one, you can edit your local computer's hosts file.  Below is a step by step on how to do that.

Some good reasons to edit your hosts file is to be able to view the site with the code unaltered to contend with the temporary URL.  Another reason is if you are using absolute paths in your code, these will work with the edited hosts file entries.  Images are usually called by a path of '/images/picture.jpg' for example.  This path will not work with the temporary URL but will with the edited hosts file.

Here are the steps to editing your hosts file.  NOTE:  If you are using Windows 7 you will need to make sure you are running 'Notepad' as the administrator.

1.  Open the hosts file in notepad from the following path:  C:\windows\system32\drivers\etc\hosts
2.  At the bottom of the page, enter the IP address and the domain name with and without the 'www'


3.  Click 'File', then 'Save'

Once this is done you can now browse to the domain without the temporary URL.  Everything path in your code should work properly now.  Please note that if your browser is open to the site while the change is made to your hosts file, you will more than likely need to close the browser and open a new session.

Troubleshooting

If you have changed the to our name servers and propagation has completed and you've made changes to the site and they aren't showing up you may have forgotten to delete the entries in your hosts file.

If the site has moved to a different server or different IP within our hosting, you will need to edit the hosts file to reflect the proper IP.

NOTE:  WHEN YOU'VE CHANGED THE NAME SERVERS TO THE CFDYNAMICS SERVERS AND PROPAGATION HAS COMPLETED, YOU WILL NEED TO DELETE THE ENTRIES IN YOUR HOSTS FILE AND SAVE THE FILE AGAIN.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 7121