Skip to content

Instantly share code, notes, and snippets.

@mskian
Created March 10, 2016 03:56
Show Gist options
  • Save mskian/8dbdb14354ad140ddb5a to your computer and use it in GitHub Desktop.
Save mskian/8dbdb14354ad140ddb5a to your computer and use it in GitHub Desktop.
htaccess code for non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment