HOME    articles    tutorials    tool directory    about

Free Email
META Tag Generator



Implementing Automatic Redirection

How to automatically forward visitors to another page

On occasion you might wish to automatically forward visitors from the page they arrive on to another - without requiring any intervention on their part. Perhaps you've moved a popular page to another location on your site, but people are still going to the old URL because links from other sites are sending them there. Rather than letting those visitors receive a disappointing "page not found" message, you can zip them right on to their intended destination.

Another reason to redirect visitors is as a logging technique. For example, if you're an affiliate for a program, and wish to send traffic to that program from your email newsletter, how can you tell how many people are following that newsletter link? If the link sends them directly to the affiliate site, you can't (you'll have to trust the affiliate recordkeeping to tell you). But if you send those clicks via a page on your own site, you can. All you have to do is check your log files to see how often that intermediate page is viewed (it will be there only for this link and there would be no other reason for it to be visited). Or, as a less effective alternative you can put a hit counter on the intermediate page.

Forwarding visitors to another page is easy to do using the Meta Refresh tag, which looks like this:

<META HTTP-EQUIV="Refresh" content="0; url=http://www.mysite.com/newpage.html">

The tag goes in the <HEAD> section of your page. content="0; specifies how many seconds the browser should wait before redirecting. A value of 0, as in our example, means to forward immediately. If your page contains a message that you want visitors to see before being redirected (such as "this page has moved to newpage.html") then use a higher number.

Although not strictly required, it's common practice to include a clickable link on the intermediate page that will also take the user to the same destination as the refresh tag. This provides an alternate route in case the browser doesn't forward the visitor automatically, or if the surfer is too impatient to wait. Something like this will do the trick nicely:

<P ALIGN="center">We are transferring you to the requested resource. If it doesn't appear quickly <A HREF=" http://www.mysite.com/newpage.html ">click here</A>.</P>

###


HOME    articles    tutorials    tool directory    about

(c) copyright 2000-2010 Anventure.  All Rights Reserved.
privacy policy