note 36245 deleted from reserved.variables by didou
| From: | didou@php.net | Date: | Thu, 02 Oct 2003 08:58:08 +0000 |
| Subject: | note 36245 deleted from reserved.variables by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57589@lists.php.net to get a copy of this message | ||
Note Submitter: kuper@grinnell.edu
----
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.