The Mozilla SwitchHosts extension or add-on is useful if you want to switch your web host, but prefer to try the new host out before committing to it. It is a big step to change your website hosting service, and you certainly want to know that it will handle your blog before you take that step.
To do that you will have to point your computer to your new hosting service as being the current one. There is a file in your operating system known as the ‘hosts’ file, which provides your computer with the IP address of the hosting service for named domains. In order for your computer to detect the temporary service as hosting your blog, you must change the contents of the hosts file. If you use Firefox, here is how to achieve that quickly and easily using a Mozilla add-on.
Switching your WordPress Blog
Let’s take a WordPress blog as an example. Perhaps your blog has outgrown your current web hosting service and needs more server space or bandwidth. Perhaps you want a more dedicated service for your blog, such as switching from HostGator to WPEngine. Whatever the reason, it makes sense to try out the new service before moving from the old.
The easy way to do that is to set up a trial account on the new web hosting service, install and configure WordPress to mirror your existing installation, and then copy the folders and files that relate to your WP blog over to your new server. However, you still want your blog to be live rather than close it down while you set up the trial.
Switching a Website
If you want to switch a website, you can set up a directory on your new hosting server and then FTP or copy all the folders and files of your existing web root to the new server so that the entire website structure is mirrored on your new domain.
Once you have completed either of these two tasks, you are ready to test your new host. To do that, your computer must recognize your site or blog as being hosted by the new service. To achieve this you must edit the hosts file in Windows or Ubuntu if you are using that OS.
This is where the Mozilla SwitchHosts extension comes into play. It can save you a great deal of work and time seeking out and editing this file. Here’s how:
How to Use SwitchHosts
First install the Switch Hosts add-on. To do this:
- Go to your Firefox browser and click Tools -gt; Add-ons -gt; Get Add-ons
- Use the top right search box to find SwitchHosts
- Click the ‘Install’ button
- Close and restart Firefox
- Click on the Tools menu, then on SwitchHosts (Press Alt button to show Tools menu) – you get this:
- Now click on ‘Before you start (Click!)’ and you get this message:
- Click OK, so that SwitchHosts overrides the ‘hosts’ file in Windows: C:/Windows/system32/drivers/etc/hosts
- You then get a message relating to backup of your hosts file. Take a note of the location in case you want to recover it, then Click OK.
Now you can use the add-on to switch the web hosting service recognized by your computer. Here is how to do that.
Switching Your Web Host Using the Mozilla SwitchHosts Extension
A. Go to Tools on your Firefox menu bar and click on SwitchHosts>Hosts Management. You should now see the following screen:
Click ‘Add’ and you will see a screen requesting the Host Name
B. Add the name of the domain you want to switch, and the IP address of the new host. Click on the ‘Add Record’ button then OK, and your domain will be added to the new web hosting service.
Important: Add two forms of the domain: with and without the www. So you would add mydomain.com and www.mydomain.com – each separately and each with the new host’s IP address. Each should appear on the ‘Hosts Edit’ window on a separate line, thus:
Now open Run Window (“Windows button + R” or open Run Window from Start Menu). Type ipconfig/flushdns in the black box and hit enter.
C. Now choose the new host file from menu. This enables you to switch from your original host to your new host with a single click.
You can save a lot of time by using the Mozilla SwitchHosts extension. Once you have used it for the first time, you will appreciate the time and trouble you can save.
If you’re using Google chrome then you can try MultiSwitch extension. Let us know your views about this Mozilla extension.