Here was the problem. As soon as we turned on Drupal page caching, redirects from http to https (and vica versa) stopped happening. Also, sometimes the pages would end up have redirect loops (the page would just say that there were too many redirects on the page and wouldn't serve up).

See #1406686: HTTPS/HTTP, drupal page caching, and base_url break caching for details as this is a core bug. I just wanted to post a note here as this may help fix several issues I see in the queue. Possibly a note with the installation instructions of securepages would be good.

Comments

grendzy’s picture

Title: HTTPS/HTTP, drupal page caching, and base_url break caching » document recommended $base_url settings for securepages

I agree the securepages documentation is bad. I personally prefer to leave $base_url empty, but the conditional in settings.php works too.

Ken Hawkins’s picture

We also had this issue and not using a base_url did not resolve.

This same method works for the 2.x Drupal 6 version.

Would be great to have this in the readme or module page.

bisonbleu’s picture

Issue summary: View changes
Status: Active » Needs review

Stumbled on this issue: the user/register would not load because of an error: "too many redirects".

Applying the solution from #1406686: HTTPS/HTTP, drupal page caching, and base_url break caching mentioned above seems to fix this problem. Copy and pasting below for reference.

if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { 
  $protocol = 'https';
 } else { 
  $protocol = 'http'; 
}
$base_url = $protocol . "://" . "example.com" ;