Meta Refresh | Symbolic Links | Redirecting Files and Directories | Related Topics |
Suppose you are a professor whose personal Web page is maintained by your department, and you want people who find you in the University Directory and click your Web Page URL link to be taken straight to your departmental page. There are actually three different ways to accomplish this. You can use
Note: You should make sure the META
tag is used inside
the HEAD of your HTML document. That means it must appear before any
text or images in the body
document.
Here's an example:<META HTTP-EQUIV="Refresh" CONTENT="12; URL=http://www.auburn.edu/newfile.html">
Important note: make sure the URL you give is fully qualified (e.g. http://whatever/whatever). That is, don't use a relative URL.Notice that:
META
tag or the Refresh
HTTP response
header) is given as a part of every retrieval. This is an
important point. Each individual "Refresh" directive is
one-shot and non-repeating. The directive doesn't say "go get
this page every 12 seconds from now until infinity"; it says "go
get this page in 12 seconds". Also, whatever you set the content equal to is what specifies how long the page will appear before reloading to a different page. For instance, in order to "go get" a page in 6 seconds, you would type in content="6".
Neat trick: the interval can be 0 seconds! This will cause the browser to load the new data as soon as it possibly can (after the current data is fully displayed).
Why even set an interval? Suppose you are a faculty member with a personal Web page that students used before you decided to use your departmental Web page. You could leave a note on your personal Web page saying that the URL has moved and that you will be transferred to the new URL in n seconds and for your students to adjust their bookmarks accordingly.