[UPHPU] server name, http_host & same origin policy

Wade Preston Shearer lists at wadeshearer.com
Sun Mar 4 20:12:05 MST 2007


>> Cool.  How do you know the request went to http://sample.com?  Or  
>> do you
>> put the redirect in the Apache config?
>
> i usually do something like:
> if (strpos($_SERVER['HTTP_HOST'], 'www') !== 0)) {
>  header("Location: http://www.sample.com");
>  die();
> }

I would recommend simply doing that with Apache. That seems a lot  
easier and more efficient then having to include that code in the top  
of every page. Whether you are redirecting www.example.com to  
example.com or vice versa, it's a piece of cake in http.conf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20070304/c45cec05/smime.bin


More information about the UPHPU mailing list