How Do I Do the Host File Trick to View My Website?
Use the following instructions if you’re running Windows 10 or Windows 8:
See Rackspace doc for other OS: (https://support.rackspace.com/how-to/modify-your-hosts-file/)
- Press the Windows key.
- Type Notepad in the search field.
- In the search results, right-click Notepad and select Run as administrator.
- From Notepad, open the following file:
c:\Windows\System32\Drivers\etc\hosts - Make the necessary changes to the file.
At the bottom enter text for IP address. Make sure to include www and non-www. - Example see video above:
37.60.227.111 yourwebsite.com
37.60.227.111 www.yourwebsite.com - Select File > Save to save your changes. IMPORTANT: be sure to save as a host file, NOT as a text (.txt) file
- Click on “host” (the original file).
- Restart any currently open browsers
- Flush your DNS Cache
You may also want to flush your DNS cache. In Windows, go to Start/Windows button in the bottom left of your Task Bar, and in the search field type “cmd” and hit the Enter key on your keyboard.
Type the following: ipconfig /flushdns - Test your changes
In your web browser you should see your site as it appears on your testing server when typing http://yourwebsite.com/ but still be able to see the site on its current web server by visiting http://www.yourwebsite.com/
YouTube Video: https://www.youtube.com/watch?v=uLWX0cC2PaI&feature=youtu.be