You are here

Pubcookie and Drupal Non-Integration

I couldn't find this documented anywhere, so I'm documenting it here.

We have Drupal installed in the root of the webserver, but I wanted to have a subdirectory with Pubcookie authentication (completely separate from Drupal), but I couldn't get it to work. I would get sent to a non-existent URL /Pubcookie.reply rather than redirected back to where I wanted to go.

I tried setting the PubcookiePostURL to where I wanted it to go. That sort of worked -- I could load that page -- but when I tried to use that page as a form, I would get a cryptic error message about "No granting reply" that was obviously some kind of Apache error, but with no corresponding entries in error_log.

Maybe this is supremely obvious to others, but I spent an hour or two this morning trying to figure out what the problem was. Now it seems obvious: Pubcookie.reply is a magic URL that Apache knows how to reply to, but Drupal was rewriting it to index.php?q=Pubcookie.reply or something stupid like that. So I just added in another rewrite rule, modeled on and just after the Favicon.ico entry in .htaccess like this:

RewriteCond %{REQUEST_URI} !=/PubCookie.reply

Now it works just fine.

Hopefully this post will show up if anyone else gets stuck like I was.