, a code gallery for creating, saving and sharing all kinds of code snippets.

Redirect all www to non www — htaccess

Posted On: Sunday, May 4, 2014 at 12:57 PM

This snippet will redirect all www users to your non www site.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com [NC]
RewriteRule (.*)$1 [R=301,L]

You need to be logged in to comment! x


Joined on Saturday, May 3, 2014
Contributed 29 Snippets

Get Social and Share