Hi, (and first of all excuse me for my poor english)
I'm getting mad with my httpd.conf, in order to deal with mod_rewrite and a few domain names. (10)
I've read the rewriting guide, and tested all I found, but I can do what I want to.
All my documents are stocked in a location like this:
/home/vhosts/domain.com/
except for one domain name which is with the folowing form:
/home/domain/en/
(I can't change this location, the website has too files and I would have to change to many php includes)
(I precise that Im' running Apache 1.3.)
What I would like is that every subdomains of my domains are redirected in the same directory that www.
So blabla.polo.domain.com, and de.domain.com should be redirected to /home/vhosts/domain.com
So here is what I done (and it does not work)
<VirtualHost 213.186.xx.xx>
ServerName ServerAlias domain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) /home/vhosts/domain.com$2
DocumentRoot /home/vhosts/domain.com
</VirtualHost>
I did that with all <VirtualHosts> elements, except for the one precised before.
I aslo tried to do a _default_:* Virtualhost for that but it does not work.
Please could you tell me how I can deal with this problem, and precise me where I have to put the differents Rewrite* elements. (In <Virtualhost> ? Before ?)
Thank you
Matt
I'm getting mad with my httpd.conf, in order to deal with mod_rewrite and a few domain names. (10)
I've read the rewriting guide, and tested all I found, but I can do what I want to.
All my documents are stocked in a location like this:
/home/vhosts/domain.com/
except for one domain name which is with the folowing form:
/home/domain/en/
(I can't change this location, the website has too files and I would have to change to many php includes)
(I precise that Im' running Apache 1.3.)
What I would like is that every subdomains of my domains are redirected in the same directory that www.
So blabla.polo.domain.com, and de.domain.com should be redirected to /home/vhosts/domain.com
So here is what I done (and it does not work)
<VirtualHost 213.186.xx.xx>
ServerName ServerAlias domain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) /home/vhosts/domain.com$2
DocumentRoot /home/vhosts/domain.com
</VirtualHost>
I did that with all <VirtualHosts> elements, except for the one precised before.
I aslo tried to do a _default_:* Virtualhost for that but it does not work.
Please could you tell me how I can deal with this problem, and precise me where I have to put the differents Rewrite* elements. (In <Virtualhost> ? Before ?)
Thank you
Matt