Skip to content

Instantly share code, notes, and snippets.

@BumbuKhan
Created November 17, 2017 12:23
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 BumbuKhan/fc6bd0072b34f8a245c669f6935c56bf to your computer and use it in GitHub Desktop.
Save BumbuKhan/fc6bd0072b34f8a245c669f6935c56bf to your computer and use it in GitHub Desktop.
.htaccess - redirect HTTP to HTTPS
# BEGIN Force SSL
# This should be the first rule before other rules
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</IfModule>
# END Force SSL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment