Reputation: 227
For one domain I would use this
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
but I don't know how to modify it, to be working with .com and .eu .I don't want them to point to a specific folders. I just want to get rid of "www" in front, so they all point to the site's root.
Upvotes: 0
Views: 130
Reputation: 10898
Your cond must match to pick up the % variables so how about:
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^.* http://%1/$0 [R=301,L]
This will redirect any www.somedomain
to somedomain
.
Upvotes: 1