Forum Moderators: phranque
I suppose I've to put this rule in httpd.conf and apply it at Server level.
I'm using this
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.
What rewrite rule should I use?
Thanks
RewriteEngine on
#
# If "www" prefix on subdomain, get the subdomain into %1 and then...
RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.example\.com
# redirect to requested page in same subdomain, but without "www" prefix
RewriteRule (.*) http://%1.example.com/$1 [R=301,L]