Skip to content

Instantly share code, notes, and snippets.

@pgporada
Last active September 30, 2017 16:24
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 pgporada/5e6d80af902adf37eef4736f5c4a9fc9 to your computer and use it in GitHub Desktop.
Save pgporada/5e6d80af902adf37eef4736f5c4a9fc9 to your computer and use it in GitHub Desktop.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment