Skip to content

Instantly share code, notes, and snippets.

@shrop
Created August 12, 2012 13:52
Show Gist options
  • Save shrop/3331911 to your computer and use it in GitHub Desktop.
Save shrop/3331911 to your computer and use it in GitHub Desktop.
Apache redirect non-www to www
# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment