Temporary domain

From Arch Hosting Wiki
Jump to: navigation, search

We do not provide temporary domains for Web Hosting services. However, if you already have a domain and just need to test your website before it goes live there are workarounds you can employ.

Addon Domain method

* Please note that this workaround does require adding an Addon Domain, and therefore you will need to be on a Business or Enterprise plan with at least 1 free addon domain and subdomain.

To begin, let's pretend that you have a website named yourdomain.com hosted at another hosting company. You've copied your files over to your Arch Hosting account in public_html, but you want to preview your website before you update your nameservers. To do this, you should create an addon domain named something like "test.yourdomain.com", and point it to the folder you want to preview (e.g. /public_html).

Next, you should visit your DNS management at wherever your domain is hosted and create an A record named "test" (or whatever else you named your addon domain) and point it to your server's IP address.

For more information on finding your server's IP address, see the server hostname wiki page.

Once the DNS propagation is completed, you will be able to access your website via the test.mydomain.com domain. Once you're completed testing, you can remove the addon domain.

Do note that if you have a CMS like Wordpress, your code might force a redirect to the original domain (e.g. forces a redirect to mydomain.com even if you visit it with test.mydomain.com).To counteract this, you should 1) review your .htaccess to make sure you don't have any code that redirects your site to another domain, and if so remove it, and 2) if applicable update your Wordpress' wp-config.php file and add two lines of code to change your site's URL to the test.mydomain.com URL. Revert these changes once you're ready to go live with the proper URL. See this for more info.

Hosts file method

A possibly easier method is by updating your hosts file. For Windows users,

1) Search for Notepad in your Windows searchbar, and right click it to launch it as an Administrator.

2) Go to File -> Open and open the file C:\Windows\System32\drivers\etc\hosts   (You may need to change the dropdown to say "All Files" on the file open menu)

3) Add the following line to the bottom of the file:

serverip yourdomain.com

Where "serverip" is replaced with your server IP address and "yourdomain.com" is replaced with the domain you wish to preview. Once done, save the file and reboot your computer.

This will direct all traffic on your computer for that domain to your server. You can identify your server's IP address via the server hostname wiki page. Once you are ready to go live, you should repeat these steps and remove the line you added to your hosts file.