Redirect www to naked domain

Tried to use the .htaccess options provided in default install to redirect www to the naked domain.

# Option 1: rewrite www.example.com → example.com

<IfModule mod_rewrite.c>
    RewriteEngine On
    # (1)
    # RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
</IfModule>

I get there are too many redirects and it seems to be using the root path on the server in the URL that is created.

Any ideas?

Answered by Seth Giammanco!
>>>>>>> Answered <<<<<<<
3 Replies
2 Followers