[Help] Using mod_rewrite to do some stuff...

nanoman

New Member
Messages
45
Reaction score
0
Points
0
In my main .htaccess (on x10hosting account) I got this:


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/#?\ ]+/)*index\.html?\ HTTP/
RewriteCond %{HTTP_HOST} ^((www|forum)\.example\.com) [OR]
RewriteCond www.%{HTTP_HOST} ^(www\.example\.com)
RewriteRule ^(([^/]+/)*)index\.html?$ http://%1/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]



And it does this:
redirects non-www to www
redirects Index.html to "/"


but the thing is that for subdomains the "index to root" doesn't work:


forum.example.com/index.html*
forum.example.com/test/index.html
->
forum.example.com/forum/ ( >>WRONG<< )*
forum.example.com/forum/test/ ( >>WRONG<< )



I asked this at webmasterworld, but the moderator said that there is something like preventing to do the correct way, but the thing is that it's the main .htaccess and I don't see any other above the www folder. =/
Can anyone please help?
 
Top