Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2014 03:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
diff --git a/.htaccess b/.htaccess
index 7ccb6a2..fa16812 100644
--- a/.htaccess
+++ b/.htaccess
@@ -56,6 +56,13 @@ DirectoryIndex index.php index.html index.htm
<IfModule mod_rewrite.c>
RewriteEngine on
+ # Redirect HTTP to HTTPS on Acquia hosted sites.
+ RewriteCond %{HTTPS} off
+ RewriteCond %{HTTP:X-Forwarded-Proto} !https
+ RewriteCond %{ENV:AH_SITE_ENVIRONMENT} 01test [OR]
+ RewriteCond %{ENV:AH_SITE_ENVIRONMENT} 01live
+ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Set "protossl" to "s" if we were accessed via https://. This is used later
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment