Re: Quality Web Tips: Use standard redirects

On Tue, 01 Feb 2005 10:58:49 +0100, Dominique Hazaël-Massieux 
<dom@w3.org> wrote:

> Hi Lars,
>
> Le lundi 24 janvier 2005 à 11:06 +0000, Lars Buitinck a écrit :
>> In http://www.w3.org/QA/Tips/reback, you might want to add a link to
>> the following page of the PHP manual, which describes how to easily
>> send a redirect to the user:
>> http://www.php.net/manual/en/function.header.php
>
> Thanks for your input, I've added a link from that page to the PHP
> manual.

I've noticed the main thrust of this page is about not "breaking" the 
back button.  It might be worthy to note that a meta tag with a 
zero-second refresh time will not be indexed in the history of any 
major browser:

<meta http-equiv="refresh" content="0; URL=http://www.example.org/bar" 
/>

Pressing the Back button on the <http://www.example.org/bar> page will 
skip the redirecting page and go to the page you visited immediately 
beforehand.  Thus the back button is not "broken".  If, by chance, 
there is no page in the history before the redirect, all major browsers 
won't even display that there is a back option.

I agree that the best and cleanest methods for redirecting are 
server-side redirects based on Apache directives or PHP headers with 
*correct* HTTP responses.  But not everyone has access to a server-side 
solution, even these days.

Perhaps the tip should mention that if a <meta> refresh *must* be used, 
always use a zero-second refresh so the page will appear neither in the 
history, nor when pressing the back button.  Also note, that search 
engines will probably index both the blank, useless redirecting page 
*and* the target page; just to show that <meta> redirects are no 
substitute for the "real thing".

Brian Huisman
GreyWyvern.com

Received on Tuesday, 1 February 2005 14:29:41 UTC