Forum Moderators: phranque

Message Too Old, No Replies

assigning effective directory index based on subdomain (mod_rewrite)

this code example not working

         

steeve

2:50 am on Jun 1, 2005 (gmt 0)

10+ Year Member



I have several subdomains symlinked into a common directory where i want to specify the directory index file (effectively) based on the requested subdoman.

non-working example:
(assumes [mysub.domain1.mydomain.com...] and
[mysubdomain2.mydomain.com)...]

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysub\.domain1.* [NC]
RewriteRule ^/*$ /subdomain1_index.php [R=permanent]
RewriteCond %{HTTP_HOST} ^mysubdomain2.* [NC]
RewriteRule ^/*$ /subdomain2_index.php [R=permanent]
RewriteEngine off
DirectoryIndex everybodyelse_index.php

result: any scriptless request defaults to the DirectoryIndex