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

Redirect all non www to www — htaccess

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

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

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

You need to be logged in to comment! x

rpjs

Joined on Saturday, May 3, 2014
Contributed 29 Snippets

Get Social and Share

Tags