How to access a Website before it is made live on the Internet

Question: How do I access a website my new website before making it live on the Internet? We are running a test site and want to debug it before publishing the site on the Internet.

Answer: An easy way to access your new site before publishing it live on the Internet is by using a local hosts file. This should bypass regular DNS lookups and allow you to access the web site using your computer as if it were published live in DNS by using the IP address you specify in your hosts file.

Example: xyz.com is hosted on a server at the IP address 1.2.3.4 and the IP address and domain/host name are not yet resolving to the 1.2.3.4 address. All you need to do to make this work on a Windows or Mac computer is add a line containing the IP address and domain/host name.

On Windows 

  1. Press the Windows key and in the box labeled "Type here to search" type: cmd. When you see the Command Prompt App click on "Run as Administrator" 
  2. When you see the C:\>  prompt, type in the following: notepad C:\Windows\System32\Drivers\etc\hosts (copy and paste)
  3. This should open the hosts file in Notepad. Go to the last line of the file and add: 1.2.3.4 xyz.com www.xyz.com - of course use the correct IP and domain name your are trying to set up for access. 
  4. Open your web browser and you should see the site on the server you specified. 

On Linux

  1. Open a terminal window and open the hosts file in a text editor such as vi. E.G. vi /etc/hosts/
  2. Append the IP address and domain name at the end of the file and save.
  3. Open the site on the server you specified. 

On MacOS

  1. Open a Terminal under Applications --> Utilities 
  2. Type sudo nano /private/etc/hosts (you'll need your superuser password)
  3. Append the IP address and domain/host name as the last line of the file and save.
  • 0 Users Found This Useful
這篇文章有幫助嗎?

相關文章

Using FTP to upload files

Tech Note: While FTP is still a widely used and accepted protocol it is deprecated due to the...

Which verision of PERL is installed on the server?

In order to find out which perl is installed you can run perl -v This is perl 5, version 16,...

What is a domain alias and how do I add or remove a domain alias?

A domain alias is a domain which you own, but which doesn't have it's own website or unique...

How to force SSL using .htaccess

To force your site to use SSL/https you should create a .htaccess file inside your site's...