mod_rewrite. subdomain redirecting
Posted: Fri Aug 03, 2007 5:23 am
Hi, all!
I'm trying to make mod_rewrite redirect from e.g. http://username.example.com/profile to http://example.com/user/username/profile.
But it redirect it to http://example.com/user/username/
And e.g http://username.example.com/?id=34&typ=4&zsfa=2 it redirects to http://example.com/user/username?id=34&typ=4&zsfa=2
.htacces:
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com [NC]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com [NC]
RewriteRule .* http://example.com/user/%1 [R=301,L]
I'm trying to make mod_rewrite redirect from e.g. http://username.example.com/profile to http://example.com/user/username/profile.
But it redirect it to http://example.com/user/username/
And e.g http://username.example.com/?id=34&typ=4&zsfa=2 it redirects to http://example.com/user/username?id=34&typ=4&zsfa=2
.htacces:
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com [NC]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com [NC]
RewriteRule .* http://example.com/user/%1 [R=301,L]