Reputation: 3658
I want to remove www. from my site url. I have added this to .htaccess:
RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]
It works if I type www.domain.com/x but not if I type www.domain.com/x/y. The rewrite "eats" the x value.
Thanks for your help.
Upvotes: 0
Views: 535
Reputation: 1069
Try using
RewriteRule (.*) http://mydomain.com%{REQUEST_URI}
for your rewrite rule instead.
Upvotes: 1