Browse a website with hosts file

During server migration or transfer, you might want to test your websites in new server to ensure everything working properly before update your domain's name servers. To do that, please follow these steps:

1. Edit hosts file "C:\Windows\System32\drivers\etc\hosts" in your PC.

2. Add following 2 lines to last line of the hosts file:

NEW_WEBSITE_IP    yourdomain.com
NEW_WEBSITE_IP    www.yourdomain.com

*Replace NEW_WEBSITE_IP to website IP in new server, and yourdomain.com to your actual domain name.

3. Save it and then browse http://www.yourdomain.com or http://yourdomain.com in web browser, you should now see contents hosted in new server.

If your web browser still show you contents in old server, please clear your web browser cache or restart your PC. Remember to remove the added lines after complete your test.

  • 118 Users Found This Useful
Was this answer helpful?

Related Articles

Search Engin Optimization (SEO)

SEO stands for search engine optimization, it is an attempt made to improve website's rankings in...

SolidCP & MSPControl: Enable AWStats on your website

Please follow the steps below to add and view your website statistics.1. Log in to your hosting...

SolidCP & MSPControl: Redirect URL

Redirect URL will redirect your website to the destination URL.Please follow the steps below to...

Convert .htaccess rewrite rules to web.config

You can use the Import Rules function in IIS to import rewrite rules coding from .htaccess file...

Disabled PHP Functions

PHP is a popular scripting language that is commonly used to build web pages nowadays.However,...