I'm redirecting traffic for my various domains to HTTPS. Things seem to work fine on my local, but when I deploy to my production site I get the "www.mysite.cn redirected you too many times." error. I'm on Acquia Cloud, so I have limited access to debug apache stuff on the server.
I suspect that this may have something to do with the Domain Access module b/c we have another site with a couple domains running a multisite install (no domain access) and redirects / ssl work fine.
Details:
- Drupal (7.56) site running domain access (7.x-3.13) for about 10 domains for various languages (site.com, site.de, site.cn)
- Running on Acquia Cloud Professional (use of "HTTP:X-Forwarded-Proto" should handle load balancer issues)
- UCC (SAN) SSL certificate with 20 domains on it
- the .com domain (default for domain access) switches to https with no problems when deployed, all other domains give me the "too many redirects" error
- on my test environment test.mysite.com resolves to https despite the "RewriteCond %{HTTP_HOST} !^.test..$ [NC]" condition
Relevant code:
.htaccess
#Send sites to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !^.*devcloud.acquia-sites\.com$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Send PROD sites to https
RewriteCond %{HTTP_HOST} !^.*dev\..*$ [NC]
RewriteCond %{HTTP_HOST} !^.*test\..*$ [NC]
RewriteCond %{HTTP_HOST} !^.*local\..*$ [NC]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
settings.php (standard domain access bootstrap include at the bottom)
// domain access
include DRUPAL_ROOT . '/sites/all/modules/contrib/domain/settings.inc';