You are here: Getting the actual URL in browser when « PHP Programming Language « IT news, forums, messages
Getting the actual URL in browser when

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация