I have this code to prepend www. to my site:
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^m\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
This is working fine, however, I have a subdomain called users.mysite.com
if I browse to
users.mysite.com/login.php
my browser will redirect me to
www.users.mysite.com/users/login.php
which, of course, doesn’t exist. Is there any way to modify this rewrite rule so that my subdomain is handled properly?
You could add another
RewriteCond