You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by wa...@library.ho.lucent.com on 2001/07/06 15:48:55 UTC
getting URL of refused page, after OnDeny
my setup: I have files in a directory, that a user can only get if
subscribed. My apache is hacked with both C and mod_perl
enhancements to authentication/authorization. My .htaccess
looks as follows:
AuthName "library services"
AuthType Basic
<limit GET>
require subscribe idc
OnDeny http://myserver/refusals/idc.html
</limit>
the problem: when a unsubscribed user tries to go to:
http://myserver/protected-dir/document.pdf
and gets bounced to the refusal/subscription page (idc.html) I would
like to know the refused page (/protected-dir/document.pdf) so I can
send them back there when they subscribe.
I don't see any way to carry this infomation? Am thinking about hacking
more so I can have an OnDeny line like
OnDeny http://myserver/refusals/idc.html?refused=$URI
but feel like I am probably missing something! THanks for any pointers,
Bob Waldstein wald@lucent.com
Re: getting URL of refused page, after OnDeny
Posted by darren chamberlain <dl...@users.sourceforge.net>.
wald@library.ho.lucent.com <wa...@library.ho.lucent.com> said something to this effect on 07/06/2001:
> my setup: I have files in a directory, that a user can only get if
> subscribed. My apache is hacked with both C and mod_perl
> enhancements to authentication/authorization. My .htaccess
> looks as follows:
> AuthName "library services"
> AuthType Basic
> <limit GET>
> require subscribe idc
> OnDeny http://myserver/refusals/idc.html
> </limit>
>
> the problem: when a unsubscribed user tries to go to:
> http://myserver/protected-dir/document.pdf
> and gets bounced to the refusal/subscription page (idc.html) I would
> like to know the refused page (/protected-dir/document.pdf) so I can
> send them back there when they subscribe.
>
> I don't see any way to carry this infomation? Am thinking about hacking
> more so I can have an OnDeny line like
> OnDeny http://myserver/refusals/idc.html?refused=$URI
>
> but feel like I am probably missing something! THanks for any pointers,
Can you set up a custom error document handler and redirect to that,
rather than using your OnDeny? Return something like 409
("Conflict"), and Apache will do an internal redirect, from which
you can get the requesting URI in the same way that you can in
other redirects.
Actually, how is the require handled? What does your auth handler
return if the user is not subscribed? Can/does your handler do an
internal redirect?
(darren)
--
Small pleasures exclude great ones.