| |
How is auto-redirecting done?
There are a number of ways of redirecting. Here are the two main ones:-
The Meta Refresh Tag
<meta http-equiv="refresh" content="5;url=http://domain.com/page.htm">
This tag, which should be placed in the HEAD section of the redirecting
page, tells the browser to refresh the page by loading the stated URL. The
"5" tells the browser to do it 5 seconds after loading.
Nobody is against this method as long as the number of seconds delay is
sufficient for the surfer to see the page and to be able to read some of it.
A typical use is after posting a message in a forum where the poster is
given a confirmation page that, after a few seconds, automatically returns
to the forum.
However, some people question this method when the delay is set to 0
(immediate) or a tiny number of seconds. I have shown that there is nothing
whatsoever wrong with an immediate redirect. I have shown that search
engines are happy to do it, and I have shown that people want to go to what
the link text tells them is at the other end - without any delays. There are
valid reasons to set the delay to 0. Setting it higher than 0 and delaying
the surfer en-route, for the sake of making some silly people happy, is just
plain stupid.
Javascript Redirect
<script language="javascript"><!--
location.href="url"
//-->
</script>
where url is the full or relative URL of the page to redirect to.
Better still is the following script:-
<script language="javascript"><!--
location.replace("url")
//-->
</script>
In this case, the redirecting page is not retained in the browser's History,
and the Back button goes to the page before the redirecting page, thereby
avoiding that awful trap where clicking the Back button takes you back to a
redirecting page, which immediately redirects you forward again to the page
you want to leave.
The above is a typical example of an immediate redirect to the specified
URL. If the script is placed in the HEAD section at the top of the page, the
redirection occurs straight away, otherwise it may take a short time for the
page to render before the browser even realizes that the script exists.
If required, the script can be stored in an external file and loaded by the
following line, where "filename.js" is the path and name of the external
file:-
<script language="JavaScript" src="filename.js"></script>
Summary
I have demonstrated that there is nothing wrong or unethical with the
auto-redirecting method as used in search engine optimization, provided that
the final destination contains what the surfer expected to see. But the main
cause of complaint about the method is when an auto-redirecting doorway page
is listed in the search engine results. That's what I'll come to next.
|
|