Forum Moderators: phranque

Message Too Old, No Replies

getting subdomains urls automatically mirrored to the main domain

         

phoenix_fly

4:52 am on Mar 26, 2006 (gmt 0)

10+ Year Member



Hello Jim and all

I need your help on this, as Iīm kind of lost on how to do it.

I have this domain for my ecommerce website:
www.mydomain.com

And my vendors have all a url like this:
www.thisvendor.mydomain.com
www.thatvendor.mydomain.com
www.thatothervendor.mydomain.com
www.othervendor.mydomain.com
and many other subdomains

After people reach their url, I have mod_rewrite translate their urls into something like this:
www.mydomain.com/cgi-bin/virtualstores.cgi?vendor=thisvendor

Ok, untill there everything is just perfect. The issue is this: at my former host - a shared host - , in order all this could work, I had first to go to the admin panel and set that vendor's subdomain as a mirror to the main domain. In other words, that it would point to the same document root. Then I had to wait for the DNS to propagate and, a few hours later, go email the vendor that his store was online.

But now Iīve got my own dedicated server, and Iīd like to define, by some way, that all subdomains, no matter what, go read from the main domainīs document root.

Is that possible?

I thought this might be acomplished by using the VirtualHost directive, but it didnīt work at all:


NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot /home/mydomain/www
VirtualDocumentRoot /home/mydomain/www
</VirtualHost>

Any ideas?

Thanks

phoenix_fly

jdMorgan

2:12 pm on Mar 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add a ServerAlias with *.example.com as the domain?

Jim

phoenix_fly

2:41 am on Mar 28, 2006 (gmt 0)

10+ Year Member



Hey Jim!

Iīve coded this:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.mydomain.net
ServerAlias mydomain.net *.mydomain.net
DocumentRoot /home/mydomain/www
</VirtualHost>

But it didnīt work out at all. Is there sth wrong?

phoenix_fly