# HTML help needed

**URL:** https://boards.straightdope.com/t/html-help-needed/67337
**Category:** Factual Questions
**Created:** [June 2, 2001, 4:58pm UTC](https://boards.straightdope.com/t/html-help-needed/67337 "2001-06-02T16:58:09Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Fenris](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/fenris/32/498_2.png) [@Fenris](https://boards.straightdope.com/u/Fenris)
#### Post date: [June 2, 2001, 4:58pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/1 "2001-06-02T16:58:09Z")

</div>

I’m moving my web pages and I want to do one of those “you will be forwarded to the new page in just a few moments” things. I can’t for the life of me figure out how it’s done. I’ve tried reverse-engineering some other pages with that feature and am stumped.

Any suggestions?

Fenris

---

<div class="post-metadata">

### Author: ![sailor](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@sailor](https://boards.straightdope.com/u/sailor)
#### Post date: [June 2, 2001, 5:01pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/2 "2001-06-02T17:01:50Z")

</div>

I guess you didn’t try very hard because it took me seconds to reverse engineer this one:

\<HTML\>\<HEAD\>  
\<META HTTP-EQUIV=“REFRESH” CONTENT=“1; URL=http:etc.htm”\>

---

<div class="post-metadata">

### Author: ![Podkayne](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@Podkayne](https://boards.straightdope.com/u/Podkayne)
#### Post date: [June 2, 2001, 5:02pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/3 "2001-06-02T17:02:43Z")

</div>

Try this:

\<HEAD\>  
\<TITLE\>Blah blah\</TITLE\>  
\<script language=“JavaScript”\>  
setTimeout(“location=‘[http://www.mynewpage.com](http://www.mynewpage.com)’”, 20000)  
\</script\>  
\</HEAD\>

You can replace the “20000” with a higher or lower number to increase or decrease the time it takes to forward the reader to a new page.

---

<div class="post-metadata">

### Author: ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)
#### Post date: [June 2, 2001, 5:08pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/4 "2001-06-02T17:08:09Z")

</div>

Yee gads, an easy one. As first on the scene:

You do it with the META tag, usually placed in the HEAD:

\<META HTTP-EQUIV=“Refresh” CONTENT=“2; URL=http://go.here”\>

The trick is that the CONTENT attribute is heavily overloaded based on the desired operation. For “Refresh” it consists of the seconds delay and “URL=\<whatever\>” delimited by a semicolon.

I like this reference for most HTML questions:

[http://www.idocs.com/tags/](http://www.idocs.com/tags/)

And of course, there’s already two answers while I’ve been writing this, but I’ll answer anyway.

---

<div class="post-metadata">

### Author: ![handy](https://avatars.discourse-cdn.com/v4/letter/h/b5a626/32.png) [@handy](https://boards.straightdope.com/u/handy)
#### Post date: [June 3, 2001, 12:39am UTC](https://boards.straightdope.com/t/html-help-needed/67337/5 "2001-06-03T00:39:39Z")

</div>

Not all browsers support refresh. Be sure to also have a link on the page to the new page with a message ‘click here if your browser doesn’t forward you’…

---

<div class="post-metadata">

### Author: ![CurtC](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CurtC](https://boards.straightdope.com/u/CurtC)
#### Post date: [June 3, 2001, 4:05am UTC](https://boards.straightdope.com/t/html-help-needed/67337/6 "2001-06-03T04:05:58Z")

</div>

In case you’re interested, the “HTTP-EQUIV” tags were added to browsers to allow a web page to contain what normally goes in the HTTP headers. When you get a web page, there is a protocol of communication that goes on between your browser and the web server. Your browser tells the server what file it wants, along with some other stuff like what kind of files it can accept, what kind of browser it is, wheter it has any cookies to send that site, etc. The server responds by sending the file, but it’s preceded by HTTP headers that tell the browser certain things, like what kind of file it is, and maybe even another site to be redirected to.

So the HTTP-EQUIV tags are ways to get the equivalent of HTTP headers, but in the web document, for all the folks who don’t have access to setting the headers themselves.

---

<div class="post-metadata">

### Author: ![Chas.E](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@Chas.E](https://boards.straightdope.com/u/Chas.E)
#### Post date: [June 3, 2001, 4:26am UTC](https://boards.straightdope.com/t/html-help-needed/67337/7 "2001-06-03T04:26:03Z")

</div>

Hey thanks, I always wanted to know how to do that redirect trick, but I was too lazy to look it up.

---

<div class="post-metadata">

### Author: ![RealityChuck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/realitychuck/32/195_2.png) [@RealityChuck](https://boards.straightdope.com/u/RealityChuck)
#### Post date: [June 3, 2001, 3:15pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/8 "2001-06-03T15:15:30Z")

</div>

BTW, if you’re using Microsoft IIS as you web server, you can set the redirect there and it will be barely noticeable.

Of course, you need to be an administrator to do this.

---

<div class="post-metadata">

### Author: ![passerby](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@passerby](https://boards.straightdope.com/u/passerby)
#### Post date: [June 3, 2001, 4:17pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/9 "2001-06-03T16:17:08Z")

</div>

RealityChuck, excuse me for nitpicking, but it’s not only IIS that has this feature. Any modern web server allows you to redirect pages on the server side.

And while I’m at it… Podkayne, it’s not advisable to use Javascript for such things. Any browser that supports Javascript also supports the Refresh meta tag, and many people disable Javascript to avoid unexpected pop-ups etc. And always follow **handy** ’s advice and put a link in the HTML body, just in case.

---

<div class="post-metadata">

### Author: ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)
#### Post date: [June 3, 2001, 4:17pm UTC](https://boards.straightdope.com/t/html-help-needed/67337/10 "2001-06-03T16:17:42Z")

</div>

As long as this thread is not going away:

When you do this, in addition to actually putting some content with an “in case your browser doesn’t redirect” link on the page, please also actually use a positive number of seconds delay. Specifying a delay of 0 is a way to generate one of those annoying situations where the user cannot back button over your page because they just back onto the redirect page which redoes the redirection before they can click again.

CurtC is correct about the reasoning behind the META tag, and why it has the HTTP-EQUIV attribute but I wouldn’t bet the ranch on the equivalence, since it is being interpreted at a different point in the processing of the page. Logically, it’s simply too late to specify some things by the time the browser has started interpreting document content[sup]1[/sup]. Another popular use would be “Set-Cookie” headers - some references claim that IE does not honor cookies set in the META tag, but a brief experiment suggests that at least version 5 of IE will indeed honor cookies set through META tags - I just tried it, and it seemed to work on both Netscape and IE.

[sup]1[/sup] - you could prescan the content for META tags, or set status indicating you’ve handled them and restart on encountering one that invalidates your current document scanning assumptions. I doubt that anyone does. Too many anomolous situations - what does it mean if I redefine the “Content-type” header?
