>I've got a website, we'll call it MainDomain.com.
>
>I created a specialty site in a sub-directory.  We'll call the
>sub-directory Widgets.
>
>I want a different domain to point to that sub directory.  We'll call the
>new domain WidgetWorld.com
>
>My webhost will allow me to park WidgetWorld.com at MainDomain.com.
>However, if someone goes to WidgetWorld.com, it would pull up the index
>page for MainDomain.com.
>
>How can I use PHP to detect if the visitor wanted MainDomain.com (and
>display MainDomain/index.php) or WidgetWorld.com (and then display
>MainDomain/Widgets/index.php).

$HTTP_HOST - not sure if all browsers use this though(read older non 1.1
compliant)

Another question would be why do NamedVirtualHost and have an entry for that
domain point to their directory in your Apache conf file (if using apache).
Otherwise I get teh impression that you would have to wrap every conceivable
page on the sub-directory site in the main directory with the redirect PHP
script...

ie, yes, if I request just the domain name your index page can redirect to a
sub-directory...  however if I request WidgetWorld.com/thispage.php  the
requests will go to MainDomain.com/thispage.php and will return 404 error if it
doesn't exist

follow my concern?

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to