I have two domains which point to the same root and I want to force no www prefix on them:
www.tapirhostel.pl
www.tapirhostel.com
For now I have something like this:
RewriteCond %{HTTP_HOST} ^www\.tapirhostel\.pl$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.tapirhostel\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^tapirhostel\.pl$ [NC,OR]
RewriteCond %{HTTP_HOST} ^tapirhostel\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/tapirhostel/.*$
When I enter it without www everything works fine.
Problems start when you enter “www” in front. When you enter http://www.tapirhostel.pl it nicely redirects to tapirhostel.pl but when I enter http://www.tapirhostel.com it redirects me to tapirhostel.pl.
Any ideas?
this should work