Skip to content

Instantly share code, notes, and snippets.

@hmic
Created October 21, 2014 12:22
Show Gist options
  • Save hmic/ed3d499fb181d3a0defc to your computer and use it in GitHub Desktop.
Save hmic/ed3d499fb181d3a0defc to your computer and use it in GitHub Desktop.
Addition to (cakephp) .htaccess to redirect non-www to www URLs
# add this to redirect non-www to www urls
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