| doogle 2005-07-29, 6:15 pm |
| Hi,
I'm a complete newbie to apache (and Unix). Please forgive my
ignorance.
Am trying to have "Automatic Virtual Hosts" - meaning I am setting my
DNS to direct multiple domains:
domain1.com
domain2.com
to the IP of my Apache machine, as well as their respective www
subdomains:
www.domain1.com
www.domain2.com
to the same IP address.
I want to have on my server folders for each domain:
www/domain1.com/
www/domain2.com/
and I want Apache to give the content of www/domain1.com/ to a user
requesting domain1.com.
I wish it to be done automatically and not set it per domain (lots of
domains).
Managed to do it so far using:
VirtualDocumentRoot /www/%0
But it's working only for the domain itself and not for the www
subdomains, for which I get 404.
Tried:
RewriteRule www\.(.*\.\w{2,})\/(.*) $1/$2
With no success.
Please advise...
(Would appreciate as much explanations about the solution as possible
as I'm a complete ignorant and wish to understand)
Thanks!
P.S.
What if some of my domains may be of the form:
www.subdom.domain1.co.uk
I do NOT wish to map those to /subdom.domain1.co.uk/ or to
/domain1.co.uk/, only www of TLD's (or cc TLD's), not of subdomains...
Will I have to add a RewriteCond with the regex for the format I would
like to rewrite?
|