We do support Round the Clock 24 x 7 x 365 (+91) 883 012 3924
 

How to Modify your hosts File

How to Modify your hosts File


On cPanel server, “mod_userdir” (WHM >> Home >> Security Center >> Apache mod_userdir Tweak) allows you to access website through a temporary URL in the http://IP/~username format.
However, some sites will not work with a temporary URL like wordpress.
For those sites, you can configure your windows computer with the server’s IP address into “hosts” file so you can view website without pointing DNS to your server.

Follow below steps to modify the “hosts” file on a Windows® 8 or Windows® 10 system :

1. On your keyboard, type Win+X on the keyboard, or click the windows icon in the lower-left corner of your desktop interface to to open the Start menu.
2. Enter Notepad in the search text box.
3. Right-click Notepad and select Run as Administrator.
4. From the Notepad , open the following file:
C:\Windows\System32\Drivers\etc\hosts 

5. Add the destination server’s IP address and domain name under the latest entry in the file, for example:

127.0.0.1 localhost localhost.localdomain localhost4 
1.2.3.4 example.com
1.2.3.4 www.example.com
1.2.3.4 blog.example.com

Note:
In this example, 1.2.3.4 represents the destination server’s IP address, and blog.example.com represents the domain name.
6. Save your changes.
7. Reload your web browser for the changes to take effect.

To modify the “hosts" file on a Windows® 7 or Windows Vista® system, perform the following steps:

  1. Click Start.
  2. Enter Notepad in the Start menu search text box.
  3. Right-click Notepad and select Run as Administrator.
  4. From the Notepad, open the following file: C:\Windows\System32\Drivers\etc\hosts 
  5. Add the destination server’s IP address and domain name under the latest entry in the file, for example:
127.0.0.1 localhost localhost.localdomain localhost4 
1.2.3.4 example.com
1.2.3.4 www.example.com
1.2.3.4 blog.example.com

Note: In this example, 1.2.3.4 represents the destination server’s IP address, and blog.example.com represents the domain name.

6. Save your changes.
7 . Reload your web browser for the changes to take effect.

1 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *