How To REDIRECT a Web Page

There are many ways to enable users to redirect their browsers to other web pages, the simplest of which is a regular link - but in some cases, you may wish to provide a different method for your readers to move to different pages on your site.

Presently, there are two additional methods for Infopage Services subscribers to provide redirection on their home pages:

The following information provides a description of these methods, including instructions for implementing them and advice to help you decide which technique best suits your needs.


Redirecting with the <META> Tag

The easiest way to redirect users is with a <META> tag, a line of code that appears between the <HEAD> and </HEAD> tags that causes the browser to automatically load another page:

<META HTTP-EQUIV="REFRESH" CONTENT="10; URL=http://www.yourdomian.com/page.html">

(Note the quotation marks in the latter half of the tag - the quote that opens after CONTENT doesn't close until the very end of the tag. This may seem strange to users familiar with HTML, but that precise syntax is necessary for this tag.)

The blue portions of the tag should be changed to suit your needs:

  • The number that follows CONTENT indicates the number of seconds to wait before automatically redirecting to the next page. It is currently set to 10, but may be increased or decreased to suit your needs. Technically, resetting it to zero should cause an "instant" reload, but there is typically a brief delay, depending on the user's connection speed and platform.
  • The URL should be changed to the complete URL (including protocol and domain) of the document to which you want the user's browser to redirect.

A document can be redirected to another document that then redirects to another, and so on, which creates a kind of "slide show." Currently, this method is most often used to redirect users to the new location of a page that has moved.

Limitations

While the <META> redirect is the easiest to use, it has a few limitations:

  • Not all browsers support <META> redirection, so it's wise to include another method for loading the next page within the BODY of your page.
  • Redirection is automatic - unless the user's browser is programmed to issue a warning, the next page will load on its own. While this is the way the tag functions, it may be undesirable in some instances.
  • Only one URL may be specified, so it's not useful as a selection tool.

If you want (or need) to be more flexible in redirection and wish to provide the user with more control, use a different method.


Redirecting with <FORM> Buttons

A second method for redirecting makes use of the <FORM> tag, thus:

That button was created using the following HTML:

<FORM METHOD="GET" ACTION="http://www.yourdomian.com/index.html">
<INPUT TYPE="SUBMIT" VALUE="Home Page">
</FORM>

The blue portions of the HTML should be changed to suit your needs:

  • The ACTION should be changed to the URL of the document that should load when the user clicks the button.
  • The text in the INPUT TYPE="SUBMIT" tag should be changed to whatever phrase you wish to appear on the button.

The function of this sort of redirect is the same as a "regular" link and can be used in much the same ways.

Limitations

While the <FORM> redirect is more universally-applicable than the <META> version, it has the following limitations:

  • While most browsers support forms, not all do - be aware that some users (about 3 to 5 percent of the Internet community) won't be able to use the button to load another page.
  • Redirection is not automatic - the user must click the button to load the next page.
  • Only one URL may be specified - though several buttons can be included to give readers a number of options, each button is good for only one link.

This form of redirection can't be adapted to provide a number of options without adding some form of script interaction - the option that follows (redirect.exe) provides precisely that function.


Which Method Should I Use?

Deciding whether to use one of the aforementioned methods or a "plain" text link depends on your specific needs:

  • If making your pages accessible to 100% of the Internet community is the most important criterion, stick to plain, old-fashioned text links.
  • If you want the user's browser to automatically load the next page, immediately or after a few seconds, use a <META> redirect.
  • If the reader should decide when the next page is loaded, but you want something a little more eye-catching than a text link, consider a <FORM> button.

In some instances, any of the various methods will suffice - but in other instances, deciding which method to use will be guided entirely by your specific needs or design choices for a given page.


[CITIES & T0WNS