Created
March 14, 2014 08:20
-
-
Save schnell18/9543938 to your computer and use it in GitHub Desktop.
Apache mod_rewrite rule to redirect insecure http request to https
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
# Redirect insecure http request from outside of internal network to https | |
RewriteEngine on | |
RewriteCond %{HTTPS} !^on$ [NC] | |
RewriteCond %{REMOTE_HOST} !^100\.2\.[0-9]+\.[0-9]+$ | |
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a good tutorial on mod_rewrite.