Posted by news@celticbear.com on 05/15/06 21:50
I'm trying to mask a URL and found a great way to point one domain to
another while keeping the original domain name in the browser address
bar:
<VirtualHost *:80>
DocumentRoot /var/www/html/demodomain
ServerName demodomain.com
ServerAlias www.demodomain.com
RewriteEngine on
RewriteRule /(.*) http://www.actualdomain.com/$1 [P]
</VirtualHost>
But I need to be able to determine if the bowser address is
"actualdomain.com" or "demodomain.com".
I've tried to get it with these:
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['PHP_SELF'];
$servername = $_SERVER['SERVER_NAME'];
$httphost = $_SERVER['HTTP_HOST'];
$httpref = $_SERVER['HTTP_REFERER'];
$remotehost = $_SERVER['REMOTE_HOST'];
$requri = $_SERVER['REQUEST_URI'];
But $_SERVER['HTTP_REFERER'] is the only one that will show one or the
other correctly, however, ONLY after the person clicks on an href on
the page. The initial page they go to that variable will be unset.
Is there any way to determine which domain name is in the browser
address bar from the start?
Thanks!!
Liam
Navigation:
[Reply to this message]
|