mod_rewrite, changing directory
Hello,i would like to change the directory of an user (by IP) (using mod_rewrite, i don't know what to use else)
when the user type http://www.mysite.com/mypage.htm, he view /www/www.mysite.com/mypage.htm, i would like him to view /www/mysite.com/ (in fact, mysite is a variable which can have a lot of values, so i can't directly write "mysite" in my rexrite rule)
i think i would be able to get the new directory name using SERVER_NAME but i don't know how to drop the "www."
Things could be very easy if RewriteRule would use the domain name in is first argument (maybe it exists a flag for that ?)
it is possible to rewrite using an absolute directory ?
Would it be correct, adding flag(s) i don't know :
RewriteRule ^www.([a-z0-9\.]*)/(.*)\$ /www/$1/$2 [QSA]
(maybe the QSA is useless here)
thanks
