Created
April 4, 2018 21:05
-
-
Save paxperscientiam/6a08131955d0b806e78f8b2bfbd2c7b4 to your computer and use it in GitHub Desktop.
Using SSL in production only (set conditional)
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
# This assumes a, say, virtualhost on your dev machine like the following: | |
# <Virtualhost *:80> | |
# # ... | |
# SetEnv APPLICATION_ENV "development" | |
# # ... | |
# </Virtualhost> | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{ENV:APPLICATION_ENV} !^development$ | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment