Search Network

Search engine optimization, SEO and marketing

How to Auto-forward from One Website to Another

Posted at — Dec 18, 2013

The internet is changing all the time. At one time, you may have a site on one domain then you need to migrate to another different domain entirely. At the same time, you do not wish to lose the readership you had established on the previous domain. This needs you to auto forward from the first website to the new one in order to drive the users who type in the previous domain name to the new site. There are a number of ways in which you can achieve this and in the next few sections, we take a look at how you can redirect on a domain level.

For a start, you can go to your domain registrar and set an auto forward. A typical example of a domain registrar is Godaddy and they have an easy process for doing this. You can use their service to not only automatically redirect your visitors to a different website, but also mask the redirection so your visitors see the same domain name they are used to in the web browsers address bar. In this case, we are looking at how you can achieve the redirection. domain forwarding First, you need to log in to your Account manager then click on Launch next to Domain. You will therefore be presented with a list of domain names you own and you can select the one you want to forward. Simply click on Forward then select Forwarding Domains. You can then click Add Forwarding and select either http:// or https:// as your forward to option. Https is the secure version of the usual http and is used to establish a secure connection to a site.

domain forwardingYou should then select the web address where you wish to forward your domain name to. Additionally, you can select the redirect type which can either be temporary or permanent. The permanent redirect will tell user agents such as browsers and search engines that the location has been permanently changed. On the other hand, the temporary response code tells user agents that the location change is just temporary. Finally, you can select your Forward settings which can be either forward only or forward with masking.

Once you have made these changes, click on Add then Save in order for the changes to take effect. Please note that the changes may take 28 to 48 hours to take effect and you will be then able to redirect users who type the previous web address to the new domain automatically.

307 temp redirectThis has the advantage of redirecting users automatically without having to make any major changes to your site. You also get to have the additional option of notifying user agents of the changes and whether they are temporary or permanent. However, you are dependent on your domain registrar in order to make the changes and honestly, the process is quite lengthy and involving. Let us now take a look at an alternative method in which you can achieve the redirection without having to rely on your domain registrar to do it for you.

Supposing your site is hosted on an Apache web server and your web host allows you to override the configurations of your web server using a .htaccess file this is the method you can use. The mod_rewrite apache module in your web server needs to be installed and enabled in order to achieve the redirection.

The .htaccess file is a simple text file which can easily be opened and edited in a text editor such as Notepad. When using notepad, take care not to save the file with a .txt appended to the end. For instance, to redirect from a site such as to, add the following bit of code to your .htaccess file.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.a\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

This will cause the server to check the domain name portion of the first URL and send the visitor to the second domain instead. As you can see, we can set whether the redirection is temporary or permanent using the HTTP response codes 301 and 302.

Once you are done creating the .htaccess file, you can upload it to the same directory as the home page of your website. In case there is a .htaccess file already existing there, you can download it and back it up in a safe place then replace it with the new one. It is important that you test your website once you have uploaded it in order to make sure that everything is in good working order.

More on .htaccess

Redirecting a folder to another

How to do 301 redirect

Last but not least, you can use of the html Meta refresh tag in an html file to do the redirection. This is quite simple and only needs a few lines of code to achieve. It works in a variety of situations and can be adapted for any project you are working on.

In conclusion, there are several ways in which you can auto forward from one website to another. The choice you make will depend on a number of factors but in the end you still get the same result. So next time you are faced with the task of redirection on a domain level, you will have what it takes to achieve this.

photo credits: @boetter GirlieMac

comments powered by Disqus