Redirection
From Campus Web Server Help
Contents |
[edit]
Overview
To redirect users from one page to another, there are a few options, including using Apache directives in .htaccess files.
[edit]
HTML Method
[edit]
Key Piece
Place the following in the "<head>" section of the document:
<META HTTP-EQUIV="REFRESH" CONTENT = "time-in-seconds; URL=new-url">
Replace time-in-seconds with a number and new-url with the new URL.
[edit]
Example
This HTTP-EQUIV meta tag would like something like this used on a page:
<html> <head> <META HTTP-EQUIV="REFRESH" CONTENT = "5; URL=http://www.bulletin.uga.edu"> <title> Courses Website has Moved </title> </head> <body bgcolor="#ffffff"> The courses website has moved to <a href="http://bulletin.uga.edu/">http://bulletin.uga.edu</a>. <p> If you are not automatically transported to this site in 5 seconds, you can select the above URL. </p> </body> </html>
A time of 5 seconds has been chosen. Even though it may be tempting to set the time to 0, it can cause a bit of a problem for users of some browsers (including Netscape). If the "Back" button is pressed, the redirected page is immediately displayed (a "ping-pong" effect).
[edit]
Applications
A couple good places to use HTML redirects include:
- in the "index.html" (default) page of an old hosting account (use it to refer folks to your new site)
- in a confirmation page (notify the user of success/failure and then send them back to the home page after a few seconds)
