Skip to content

Instantly share code, notes, and snippets.

@chrisdavidmiles
Created June 13, 2017 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdavidmiles/f57bc367214d8147f9e9026fbbaca6bf to your computer and use it in GitHub Desktop.
Save chrisdavidmiles/f57bc367214d8147f9e9026fbbaca6bf to your computer and use it in GitHub Desktop.
301 redirect http:// to https:// for specified domain
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www.)?example\.com$
RewriteRule ^(.*)$ "https\:\/\/example\.com\/$1" [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment