Created
August 27, 2019 12:09
-
-
Save felipegenuino/94525ee9d8eee902649a0d56e93fe598 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
RewriteEngine on | |
# Check for POST Submission | |
RewriteCond %{REQUEST_METHOD} !^POST$ | |
# Forcing HTTPS | |
RewriteCond %{HTTPS} !=on [OR] | |
RewriteCond %{SERVER_PORT} 80 | |
# Pages to Apply | |
RewriteCond %{REQUEST_URI} ^something_secure [OR] | |
RewriteCond %{REQUEST_URI} ^something_else_secure | |
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] | |
# Forcing HTTP | |
RewriteCond %{HTTPS} =on [OR] | |
RewriteCond %{SERVER_PORT} 443 | |
# Pages to Apply | |
RewriteCond %{REQUEST_URI} ^something_public [OR] | |
RewriteCond %{REQUEST_URI} ^something_else_public | |
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment