Skip to content

Instantly share code, notes, and snippets.

@estevecastells
Last active April 16, 2018 18: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 estevecastells/b492f1abfddb9d8bde5ddb3c4d636443 to your computer and use it in GitHub Desktop.
Save estevecastells/b492f1abfddb9d8bde5ddb3c4d636443 to your computer and use it in GitHub Desktop.
Force HTTPS only in .htaccess
#Simple Redirect
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment