I am using the following for non-www to www on my sites :
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
I want to add a subdomain such as blog.example.com. I have two issues to figure out :
1 - Exclude the subdomain from the above rewrite as it currently rewrites blog.example.com to example.com/blog/
2 - The actual subdomain location is /blog/, but that should never be accessible to people or engines. So, /blog/* should always be blog.example.com/*
I'm guessing this is a pretty common thing, but I have not used subdomains in ages. Any recommendations would be great... I would like to keep the original rewrite intact since it is the most complete non-www to www I was able to come across to date.
thanks