Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am using the secure pages drupal module to enable https for some of the pages , but i have noticed one bug in this , each time i reload the page its toggling between http and https, and if i go from a secure page to another secure page(ex: login to registration which are bith secure according to settings) the destination page will be in http but if i refresh it toggles between secure and non secure , a similar issue is reported here

share|improve this question

2 Answers

up vote 2 down vote accepted

The source of the problem could be in several places, depending on which webserver you're using, how it's configured, etc.

Are you using Apache with mod_ssl? NOthing else 'in front', like nginx doing the SSL handshaking instead?

In any case, I'm guessing that your webserver's not consistenly serving up the required server var. In 'securepages.module', there's a check for

return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? TRUE : FALSE;

Not knowing your webserver config, find out what your webserver is doing. add,

<?php
 phpinfo();
?>

to your pages and look to see what the values of

$_SERVER['HTTPS']
$_SERVER[SERVER_PORT]

are. Or simply print them out directly ... Check if/how those values toggle on page refresh.

I'm suspicious of caching, too.

share|improve this answer

To ensure that they donot toggle between http and https, go to secure pages and let say you want to make a specific link 'mylink' secure. Write (use aesterik and forward slash before link and (forward slash and aesterik) after your link) in the list of secured pages to ensure that it is secured. I did it in multilingual site and it worked for me.

Posted this thing so that any one can take advantage of it. :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.