Forum Moderators: coopster & phranque

Message Too Old, No Replies

Correct use of Location: in http header

Must I use a blank page?

         

kaled

6:11 pm on Jul 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To redirect to another url (using a perl script) you may add the following to the http header:-

Location: http: //domain.com/page.html

My question is this. Is it legal to follow the header with a normal html page or must the header be followed by a blank page?

Thanks,

Kaled.

py9jmas

6:24 pm on Jul 10, 2004 (gmt 0)

10+ Year Member



RFC2616, 10.3.2 301 Moved Permanently
The new permanent URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).

Not only can you include an HTML body - you should do. (The same applies to 302 Found replies.)

kaled

8:55 pm on Jul 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perfect, I love a definitive answer - thanks.

Kaled.