Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Directing A Parked Domain To A Sub Directory

0 views
Skip to first unread message

Jeff Gannaway

unread,
Aug 30, 2001, 2:15:20 PM8/30/01
to php-g...@lists.php.net
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).

Thanks,
Jeff Gannaway
___________________________________________________________

Find the right art print for your home.
* Search by artist, color, art style and subject.
* Preview the art prints against your wall color.
* Specializing in contemporary, abstract and African
  American art.
* Every day discounts on thousands of fine art prints.

PopStreet.com is your avenue to art.


http://www.popstreet.com
___________________________________________________________

Dave

unread,
Aug 31, 2001, 8:48:24 AM8/31/01
to Jeff Gannaway, php-g...@lists.php.net
>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

0 new messages