note 53048 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 20 Apr 2007 14:46:06 +0000 |
| Subject: | note 53048 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125664@lists.php.net to get a copy of this message | ||
Note Submitter: tylerd gmail
----
I was sick of the cookie domain handling issues presented by my situation:
www.foo.com/phpBB2/ - my forum
forum.foo.com - vhost to www.foo.com/phpBB2/
forums.foo.com - vhost to www.foo.com/phpBB2/
So to force all users to use the vhost I prefer (forum.*) while still passing on the entire URI
(like if they were linked to a post) I added this to phpBB2/includes/page_header.php:
<?php
if($_SERVER['HTTP_HOST'] != 'forum.foo.com')
{
if(!strstr($_SERVER['REQUEST_URI'], "phpBB2")) { header("Location: http://forum.foo.com" .
$_SERVER['REQUEST_URI']); }
else { header("Location: http://forum.foo.com" .
substr($_SERVER['REQUEST_URI'], 7)); }
}
// yadda yadda yadda
?>
I'm sure this would work for many other situations.