note 44711 deleted from ref.http by tomsommer
| From: | tomsommer@php.net | Date: | Sat, 14 Aug 2004 01:54:59 +0000 |
| Subject: | note 44711 deleted from ref.http by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74608@lists.php.net to get a copy of this message | ||
Note Submitter: madsen@lillesvin.linux.dk
----
Instead of using META and/or JavaScript redirects, use the Location header, as it doesn't break
the browsers Back-button.
E.g.:
<?php
$redirectTo = "http://php.net";
header("Location: " . $redirectTo)
?>
It also supports relative URLs, even though I don't think they conform entirely to the HTTP/1.1
specification. But I've never experienced them not working.
header("Location: " . $redirectTo); sends a 301 response to the browser, which
_doesn't_ break the back button, unlike the META and/or JavaScript redirects does.