Created
December 2, 2016 13:55
-
-
Save trplll/3dec037dcc2e62bde0efc530b0643353 to your computer and use it in GitHub Desktop.
Apache .htaccess redirect configurations
This file contains hidden or 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
#Forces any http request to be rewritten using https | |
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
#also forces directly linked resources (images, css, etc.) to use https | |
#RewriteEngine On | |
#RewriteCond %{HTTPS} !=on | |
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
#force a domain to only use SSL SSLRequireSSL directive with the +StrictRequire | |
#SSLOptions +StrictRequire | |
#SSLRequireSSL | |
#SSLRequire %{HTTP_HOST} eq "example.com" | |
#ErrorDocument 403 https://example.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment