Skip to content

Instantly share code, notes, and snippets.

@rgergo67
Created September 24, 2016 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgergo67/c19a241860a506d32da92442fe5de4d2 to your computer and use it in GitHub Desktop.
Save rgergo67/c19a241860a506d32da92442fe5de4d2 to your computer and use it in GitHub Desktop.
htaccess www
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www..+$ [NC]
RewriteCond %{HTTP_HOST} (.+)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment