but when I put a .htaccess file to the subdomain directories, like
- Code: Select all
RewriteRule ^index\.html$ index.php [L]
in order to rewrite
- Code: Select all
http://tom.example.com/index.html
to
http://www.example.com/2/index.php
making additional rules for the subdomain, they all display my home page -- http://www.example.com
.htaccess is in directory http://www.example.com/2
can this file work or how can I put the additional rule to the rules below ? thank you !
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteMap user_to_id txt:/path/to/map.txt
RewriteRule ^/help(/.*)?$ - [L]
# Fix missing trailing slashes.
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond ${user_to_id:%2} ^([0-9]+)$
RewriteCond %{DOCUMENT_ROOT}/%1%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond ${user_to_id:%2} ^([0-9]+)$
RewriteRule ^(.*)$ /%1/$1 [QSA,L]