Skip to content

Instantly share code, notes, and snippets.

@samurailink3
Created April 8, 2013 10:13
Show Gist options
  • Save samurailink3/5335737 to your computer and use it in GitHub Desktop.
Save samurailink3/5335737 to your computer and use it in GitHub Desktop.
Apache2 www-rewrite file. Put file in root www folder. This will add 'www' to each website.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment