Forum Moderators: phranque
is there a 301 code that i can place on the root directory to redirect all the subdomains?
# If HTTP hostname header is non-blank
RewriteCond %{HTTP_HOST} .
# and if requested hostname is NOT www.example.com
RewriteCond %{HTTP_HOST} !^www\.example\.com
# Redirect to www.example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]