Skip to content

Instantly share code, notes, and snippets.

@synCRAUNicity
Forked from stiplady/.htaccess
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save synCRAUNicity/69119fda92aba134c2ac to your computer and use it in GitHub Desktop.

Select an option

Save synCRAUNicity/69119fda92aba134c2ac 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