Created
November 11, 2017 06:08
-
-
Save locvfx/61dffab5386248d839aca30a0872b812 to your computer and use it in GitHub Desktop.
Force https
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -----------------------Force https---------------------------------------------------------- | |
RewriteEngine On | |
# This will enable the Rewrite capabilities | |
RewriteOptions InheritDownBefore | |
# This prevents the rule from being overrided by .htaccess files in subdirectories. | |
RewriteCond %{HTTPS} !=on | |
# This checks to make sure the connection is not already HTTPS | |
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [QSA,R,L] | |
# This rule will redirect users from their original location, to the same location but using HTTPS. | |
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/ | |
# ----------------------\Force https---------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment