I'm writing a www to non-www redirection with the following code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
However, www.mywebsite.com
redirects to mywebsite.com/www/
instead of mywebsite.com
.
I suspect this might be due to the DocumentRoot
configuration of a VirtualHost, but I cannot access the httpd.conf file since I'm on a shared environment.
Any ideas?