Redirect a Web page to a different Web page
Original page: <examplehtml.htm>
Target page: <http://www.austincc.edu/mparker/prereqm/redir.htm>
Watch it work: To see how redirecting works, go to my web page examplehtml.htm and see that you do get transferred to the target page after 4 seconds. (You can make it faster or slower, of course. Normally I'd use about 2 seconds.)
Here is a similar example file, but it re-directs the page after 20 seconds. Normally you would not ever want to wait that long, but I am including this because I think that staying on the page 20 seconds before re-direction will allow you to view the source of the redirect page or copy the redirect page so that you can then edit it yourself.
How to do it:
You can copy my page from one of the links above and change the target file (in two places) and the number of seconds delay (in one place) and then use it as your own.
Look at the source of the redirect page. Follow the above link and then choose "View > Source" or "View > Page Source" in your browser.
Notice that there are two places to put the target address. Also notice that there is a place to choose how many seconds to wait. My first file above has this line:
<META HTTP-EQUIV="Refresh" CONTENT="4;URL=http://www.austincc.edu/mparker/prereqm/redir.htm">
To change the number of seconds from 4 seconds to some other amount, change the number right after "CONTENT."
If you want to put more text in the body of the page, that is OK. However, you should make the delay time longer as you add more text because the viewers will be very frustrated when the page goes away after 4 seconds if it would take them 10 seconds to read all the text on the page!
This HTML command is supported in HTML 3.2 and later, which any current browser should support. If a browser that only supports older versions of HTML is used, then it should just ignore that command and show the page. Then a viewer could click on the link on the page and go to the new page.Why don't I make it transfer after 0 seconds? I could. However, then the "Back" button on the viewer's browser won't work, because when it goes back, it hits the transfer page and goes forward again. This is called "breaking the Back button" and is considered very bad in web design. Users get used to being able to go "Back" and get frustrated when it doesn't work.
Why don't I put more explanation on the page? If you put a lot of explanation and then the transfer happens fast that is frustrating for the viewer because they see that the page has text they are unable to read before the page goes away. On the other hand, if you don't put any text on the page, then there is nothing to help the viewer whose browser doesn't execute the HTML command to redirect. My compromise here is to put a very short sentence as a link. People should be able to read it fast enough that it isn't frustrating. But if the redirect doesn't work, it's obvious that the viewer should click on it.
Last updated February 24, 2008 . Mary Parker
(I also know how to do this in Javascript too, but when I first wrote this in 1999, it was not recognized by as many browsers, so I didn't recommend it then. However, I keep the directions available just in case anyone is interested.)