Re: [PHP3] Re: domain alias
| From: | Jess | Date: | Fri, 16 Jun 2000 14:06:06 +0000 |
| Subject: | Re: [PHP3] Re: domain alias | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2068@lists.php.net to get a copy of this message | ||
You can use something like this:
<?php if ( $HTTP_HOST == "www.yourdomain.com" ){
header("Location: http://www.yourdomain.com/someindex.html");
//
This is the redirection function.
exit;
}
?>
"Arjen Tempel" wrote in message <200006140815.KAA18557@wave.wib.hva.nl>...
>Date sent: Mon, 12 Jun 2000 12:51:45 -0700 (PDT)
>From: Ezra Freedman <ezra_freedman@yahoo.com>
>To: php3@lists.php.net
>Subject: domain alias
>
>> Hello.
>> I have a website that has two domains pointing to the
>> same IP. (I believe these are called domain aliases)
>> Is there any way I can find out (from PHP or the logs)
>> what the user typed in for a particular request for
>> index.html?
>
>This is the code I used for a site I designed:
><?php
>if (eregi("www\.piercingsonline\.nl",$HTTP_HOST)) {
> include "piercingsonline.htm";
>} else {
> include "goudonline.htm"; }
>?>
>
>It is placed as index.php3 in the root of the site.
>There are also two plain html pages in the root:
>piercingsonline.htm - used only if the URL is www.piercingsonline.nl
>goudonline.htm - used if any other URL is used (www.goudonline.nl or
>212.189.140.196)
>
>You should check phpinfo() to see if the $HTTP_HOST variable is set
>on your server. (Not all servers set the same variables !!)
>If it isn't, there's should be another variable with the same
>information.
>
>Arjen Tempel
>
>--
>PHP 3 Mailing List <http://www.php.net/>
>To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net
>To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net
>To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>