Redirecting Pages

Introduction

 

Redirecting means automatically loading a new page without the need for the surfer to click on anything to do it. There are many reasons for doing it. For instance, some sites buy variations of their main domain name but they don't maintain fully operational sites for each variation. Instead, when surfers arrive at one of the variation sites from typing it into the browser's address window, they are redirected to the main site. This is exactly what surfers want to happen. Search engines and others do it all the time. There are other reasons to redirect such as browser specific pages (when different HTML pages are created for different browsers). One page ascertains what browser a visitor is using and automatically loads a suitable page for it.

It is sometimes said that redirecting is unethical and it is included in some people's list of spam techniques. But is it better to speedily move surfers along to the main site where they actually want to go, or to waste their time by stopping them, making them read some text and then asking them to click again to finally get to the site? If it is unethical and/or spam, then the search engines themselves, Microsoft and other big names are guilty. Like many things, the redirecting technique can be used unethically by taking surfers to sites and pages that they definitely did not want to go to.

Types of Redirecting

There are a number of ways to redirect visitor. Some are server based and some are contained in the HTML page that does the redirecting. People sometimes include cloaking in the server based methods although strictly speaking it isn't redirecting as described above. Here, we will focus on those techniques built into the HTML page.

JavaScript Redirects

by Tommi Neuvonen
These are small pieces of JavaScript that are placed anywhere in the head or body section of an HTML page - one per page. They only work with JavaScript enabled browsers which covers just about everybody. Even so, a link to the next page should be included on the page for the very few people who use non-JavaScript browsers. With JavaScript redirects, surfers often catch a glimpse of the redirecting page as it passes through their browsers. To avoid them seeing anything, a string of line breaks ( <br> ) could be included to push the page's printable text to below the bottom of the screen. To further camouflage the page, the background color could be the same as the site's background.

Unconditional redirect:
<script language=javascript><!--
top.location.replace("http://www.example.com/");
//-->
</script>

The script automatically loads the "example.com" site and it does it every time - it is unconditional. The url of a specific page can be used, of course. If you know any HTML, you will notice that the script itself is contained between comment tags. This is for those non-JavaScript enabled browsers. They don't recognize the <script> </script> tags and they would print whatever is between them if it weren't commented out. Those who are familiar with javascript may note that the same effect could be acheived with the line: top.location = "http://www.example.com/" However using the replace() method as we chose keeps the history (the stuff accessible by use of the browser 'back' button) tidy by actually replacing the current URL with the new one.

Conditional redirects

Sometimes it is useful to redirect in some circumstances but not in others. One of them is with framed sites. Pages that normally belong inside a frame structure are often unusable outside it. If the following script is placed in each framed page, the site will automatically be loaded and brought together but only when the page is not in a frame structure. If a surfer arrives at one of the pages instead of the at the site's index/frameset page, then the site will automatically be pulled together.

<script language=javascript><!--
if (top == self) location.replace('http://www.example.com/');
//-->
</script>

The script automatically loads the site if the page finds itself at the top of the browser's document object model, and only in that circumstance. If it is at the top, then there is no frame structure, the page is not in its proper place and the site is automatically loaded.

Meta tag redirect (refresh)

Click here for information about the refresh meta tag.

Caution When Redirecting

Proper use of redirecting is neither unethical nor spam. Of that there is no doubt. But it has to be said that there are people out there who don't see it in the same way. Because redirecting can be used unethically to take surfers to places that they didn't want to go, these people choose to declare that ALL redirections are unethical, in spite of the fact that they can clearly see top web companies such as the major search engines and Microsoft using the technique. Where their reasoning comes from is impossible to fathom. Unfortunately, these people do matter.

If any of these people spot your redirecting doorway page ranked above theirs for a particular phrase, they may report it to the search engine concerned. Most of them wouldn't but some of them would. Because the redirection doesn't mislead surfers, the chances are that nothing would happen, even if someone at the engine checked it out. However, some people who work at the engines are human and must work quickly, so it is possible that your page, and even your site, could be banned from the engine. Very many webmasters use redirects without any problems at all but you must be aware that problems could occur.

Back to the Help File / Tutorial Directory
Visit our Web Marketing Glossary

 

©Copyright 2000 - 2005, Association of Internet Marketing Professionals, Inc., All Rights Reserved.
All rights reserved.

 

Back to Top