note 67108 added to function.header
| From: | spongebob3 at hotmail dot com | Date: | Sat, 03 Jun 2006 11:47:04 +0000 |
| Subject: | note 67108 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-113094@lists.php.net to get a copy of this message | ||
If you don't want people to go to
http://example.com/index.php?id=5,
but want them automatically redirected to
http://www.example.com/index.php?id=5
or
http://prefix.example.com/index.php?id=5
(so with the 'www.' or the 'prefix.'), this function might be useful:
<?
if (!strstr($_SERVER['HTTP_HOST'],"www."))
{
Header("Location:http://www.".$_SERVER['HTTP_HOST'].
"/?".$_SERVER['QUERY_STRING']);
}
?>
Replace the 'http://www.' to your own prefix. E.g.
'http://prefix.'.
----
Server IP: 83.137.20.120
Probable Submitter: 84.30.5.187
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/note/edit/67108
Del: integrated -- http://master.php.net/note/delete/67108/integrated
Del: useless -- http://master.php.net/note/delete/67108/useless
Del: bad code -- http://master.php.net/note/delete/67108/bad+code
Del: spam -- http://master.php.net/note/delete/67108/spam
Del: non-english -- http://master.php.net/note/delete/67108/non-english
Del: in docs -- http://master.php.net/note/delete/67108/in+docs
Del: other reasons-- http://master.php.net/note/delete/67108
Reject -- http://master.php.net/note/reject/67108
Search -- http://master.php.net/manage/user-notes.php