note 72108 deleted from ref.url by nlopess
| From: | nlopess@php.net | Date: | Wed, 03 Jan 2007 12:17:23 +0000 |
| Subject: | note 72108 deleted from ref.url by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121232@lists.php.net to get a copy of this message | ||
Note Submitter: orijing at gmail dot com
----
In response to Joe, I decided to force my users to use the no-www version of http://originxt.com (as opposed to http://www.originxt.com). To make life easier for them, I
redirected the REQUEST_URI too. Include this in index.php at the top and your life will be settled.
Oh by the way, you should use the $_SERVER[] array for HTTP_HOST. It's safer.
<?php
if(preg_match("/^www\./i", $_SERVER['HTTP_HOST']))
{
header("location: http://originxt.com".$_SERVER['REQUEST_URI']);
}
?>
It's a much more elegant solution. Replace http://originxt.com in the header() with your no-www url.