|
Posted by Jerry Stuckle on 05/16/06 04:06
news@celticbear.com wrote:
> 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
>
Why go to all that trouble? Just create an alias entry for the other domain.
No rewriting necessary.
Or, if you want different options, create another virtual host for the other
domain and point it at the same directory.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|