I have a domain example.com in which I'm doing this to redirect all my traffic from www version to non-www:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Everything fine until now. I can do www.example.com to example.com, but I also have another domain which I am hosting on the same account as a addon domain. Like there is a folder like example.org in my base www directory of example.com.
Now when I'm doing www.example.org, I get http://example.com/example.org
with an additional 404.
Hope you get my point. Thanks in advance.