RE: [PHP] Directing A Parked Domain To A Sub Directory
| From: | (Dave) | Date: | Fri, 31 Aug 2001 12:48:24 +0000 |
| Subject: | RE: [PHP] Directing A Parked Domain To A Sub Directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65462@lists.php.net to get a copy of this message | ||
>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