note 36245 added to reserved.variables
| From: | kuper at grinnell dot edu | Date: | Thu, 02 Oct 2003 07:48:57 +0000 |
| Subject: | note 36245 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57583@lists.php.net to get a copy of this message | ||
Here's a tiny scrap of code I came up with. Suppose you have more than one hostname, but for
whatever reason, you'd like everybody who goes to any of them to end up at the same one. All
you have to do is add something like this to the <head> part of your index.php file:
<?php
$hostname=$_SERVER['HTTP_HOST'];
if ($hostname == "ugly.hostname.org") {
echo '<meta http-equiv="refresh" content="1;URL=http://prettyhostname.org">';
}
?>
It's simple and it works.
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36245
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36245&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36245&report=yes