Last active
February 28, 2019 10:02
-
-
Save Langmans/51913df2cb192e44ae19af8bfa084ada to your computer and use it in GitHub Desktop.
.htaccess dynamic environment for slim framework (development, testing, acceptance, production) var based on hostname and current env
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
# env based | |
SetEnvIf SLIM_MODE ^(development|testing|acceptation|production)$ SLIM_MODE_FROM_ENV=$0 | |
SetEnvIfNoCase Request_URI /projects/ SLIM_MODE_FROM_REQUEST=testing SLIM_MODE_RULE_6=1 | |
SetEnvIfNoCase Host ^accepta(nce|tie|tion)\d*\. SLIM_MODE_FROM_REQUEST=acceptation SLIM_MODE_RULE_5=1 | |
SetEnvIfNoCase Host ^(beta|test(ing)?)\d*\. SLIM_MODE_FROM_REQUEST=testing SLIM_MODE_RULE_4=1 | |
SetEnvIfNoCase Host \.(dev|test(ing)?|local(host)?)$ SLIM_MODE_FROM_REQUEST=development SLIM_MODE_RULE_3=1 | |
SetEnvIfNoCase Host ^localhost(:\d+)?$ SLIM_MODE_FROM_REQUEST=development SLIM_MODE_RULE_2=1 | |
SetEnvIf SLIM_MODE_FROM_REQUEST ^$ SLIM_MODE_FROM_DOMAIN=none SLIM_MODE_RULE_1=1 | |
# priority: mode from env or mode from domain or production | |
SetEnvIf SLIM_MODE_FROM_REQUEST ^(development|testing|acceptation|production)$ SLIM_MODE=$0 | |
SetEnvIf SLIM_MODE_FROM_ENV ^(development|testing|acceptation|production)$ SLIM_MODE=$0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment