Pin Me

Ways to Redirect a Website Address to Another Site

written by: vishalseafarer•edited by: Christian Cawley•updated: 3/8/2011

With the use of smart phones on the rise and around 5 major browsers used by internet surfers, you would want everyone to have a good satisfactory experience when they visit your website. Website redirect is a really important technique that should NOT be overlooked. Check out why and be surprised.

  • slide 1 of 4

    What is a Website Redirect?

    A website redirect is made possible by adding a couple of lines of code to the web page so that it is executed when some condition is met. When the browser processes this code, it will take you to another website as specified in the underlying code. Using website redirect is a good practice while you develop websites. This will help the user to get to the right website

  • slide 2 of 4

    Why Should You Redirect a Website Address to Another Site?

    There are many reasons to redirect a website address to another site. Listed below are the reasons why website redirects are used.

    redirect a website address to another site 1) Website redirects are mainly used because you might land on a website that might have been moved to a new website address, or you might have landed on a web page that doesn't exist anymore.

    2) Website redirects are used when you enter a wrong address or an improper address. The DNS server detects this and redirects you to an information page or an advertisement page.

    3) With the rise in the number of people using smart phones, people can stay connected all the while. When a website has to be rendered to a browser present on the cell phone, it has to be optimized for viewing on the small screen.

    4) Some websites use auto redirects so that you view their advertisements before proceeding to the main page of their website.

  • slide 3 of 4

    How to Redirect a Website to Another Site

    To redirect a website address to another site, you can do it in one of the following ways.

    1) Use extra code in the web page to automatically redirect the user to another website or web page. The extra code usually comprises of using meta tags or using JavaScript or using server side scripts. If you want the user to decide on whether or not to be redirected, simply add an anchor tag (<a href=""> </a>) and provide a link to another website that you would want the user to go.

    Using meta tag:

    Adding the following line of code in your webpage will redirect the browser to google.com. You can change this by entering the name of your new website in the url field.

    <meta http-equiv="refresh" content ="5; url=http://www.google.com">

    Using JavaScript:

    The setTimeOut() method is used change the window.location property of the browser. Thus the website redirect is implemented this way to redirect a website to another site after the specified number of milliseconds.

    <head>

    <title>Page Auto Redirect</title>

    <script language="javascript" type="text/javascript"><!--window.setTimeout('window.location="http://www.google.com"; ',2000);// --></script>

    </head>

    2) Check the version and vendor of the browser and redirect the user accordingly so that the user gets to see your website just the way you wanted him/her to see.

    3) If the browser used is a mobile browser like Opera Mini or Safari for iPhone or Firefox for Android, redirect them to a mobile compatible website or a mobile website. Mobile websites usually have a 'm' (without quotes) followed by a period (.) followed by the website address.

    Examples of popular mobile websites are m.google.com, m.gmail.com, etc.

    Conclusion:

    It is important to learn how to redirect a website address to another site. Thus you will not have to worry about the traffic you have been getting to your old website (if you have moved all your website's contents to a new location.) For advertisers, there has never been a better strategy in making sure that the user views the advertisements for a few seconds before he/she is redirected to another site.

    Learn the various ways in which you can redirect a web page to another site please refer to Auto Redirecting a Web Page with HTML Code.

  • slide 4 of 4

    References

    Author's own experience.

    Screenshot provided by author.