I have used this module on another site without any problems but on the current site I'm working on it switches to https but not back again. I was also getting a double slash which I've temporarily fixed by using.

$path = !empty($_REQUEST['q']) ? trim($_REQUEST['q'],'/') : '';

Any suggestion?

Comments

marcus178’s picture

One thing I thought of is that the server is a Zeus server rather than apache. Could this be causing the problem?

alanthing’s picture

I'm having the same problem with a Zeus load balancer. A URL that is not listed in the paths to redirect to https will not load as http.

I've added this to my Apache config (per http://www.metaltoad.com/blog/running-drupal-secure-pages-behind-proxy) and added rules in the Zeus config to set X-Forwarded-Proto for the appropriate protocol:
SetEnvIf X-Forwarded-Proto "https" HTTPS=on

I've also tried adding the logic in settings.php with no changes. Though, I understand from the issue queue that this may no longer be necessary.

I edited the module to return another header to troubleshoot:

  header('Location: '. $url);
  header('X-Location: '. $url);

And for whatever reason, Location is wrong but X-Location is right (removed irrelevant data):

$ curl -H "Host: www.example.com" -i https://11.22.33.44/status --insecure -s
HTTP/1.1 302 Found 
Server: Apache 
Location: https://www.example.com/status 
X-Location: http://www.example.com/status 

I've tried many different troubleshooting techniques and cannot get Location to come back to my system in http.

alanthing’s picture

I found the result here: http://community.riverbed.com/t5/Answers/Redirect-to-HTTP-from-HTTPS/td-...

I have Riverbed Sting Ray load balancers, and the interface here is set with:
Virtual Servers > [select your virtual server] > Connection Management > Location Header Settings > location!rewrite > Nothing

Now, my Location header is not being modified when sent back to curl (or my browser)

alanthing’s picture

Status: Active » Closed (works as designed)