Rewrite code for redirecting all traffic to www subdomain (htaccess & apache conf)
I pretty much always forget this. Here’s how:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com
RewriteRule ^(.*) http://www.example.com/$1 [last,redirect=301]
