Skip to content

Instantly share code, notes, and snippets.

@stiplady
Created February 9, 2014 18:07
Show Gist options
  • Select an option

  • Save stiplady/8903277 to your computer and use it in GitHub Desktop.

Select an option

Save stiplady/8903277 to your computer and use it in GitHub Desktop.
Redirect non-www urls to www
# You might not need this line if it already exists in your .htaccess file
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment