This issue is a tricky one. Let's say we have node/100 which is aliased as 'private'
We configure securepages to secure 'node/100' and check 'Switch back to http pages when there are no matches'.

When anonymous users go to the page it won't find a match and they go back to the front page. (Actually there is a lot more going on, but this is the result)
When logged-in users go to the page it will find a match and they get the secured page.

Problem:
hook_init is called for anonymous users before $_GET['q'] is set correctly by drupal_init_path() (because of page caching) and path will be the aliased path, not node/100.

Fix:
Fix the path using drupal_get_normal_path(), see the patch.

These might be some related issues:
http://drupal.org/node/211850
http://drupal.org/node/559304

Hope this is helpful for those using 5.x. Didn't check if this is already fixed in 6.x version of securepages.

CommentFileSizeAuthor
securepages.patch659 bytesp.brouwers

Comments

171mayank’s picture

I also having same kind of problem but I think the cause is different with your.
The problem is with "page cache". Drupal is not calling the hook_init function as the page is getting cache.
I found that the page goes to https ones after clearing the cache tables in the database but afterword it stop working as the page cached in the table again. When I placed the code of the function hook_init into hook_nodeapi with $op == view it problem look likes solved for me.

Is am doing some thing wrong?

171mayank’s picture

I fine a great module that disable the cache on the specified pages. http://drupal.org/project/cacheexclude
Enable this module and give the node/{nid} of the page on which you want to apply https in the admin/setting page.

grendzy’s picture

Status: Active » Closed (won't fix)

The 5.x branch is no longer supported. If this issue is still present in a current version of Secure Pages, please update the issue summary, change the version field, and re-open the issue.