Apache-JumpByReferer
view release on metacpan or search on metacpan
lib/Apache/JumpByReferer.pm view on Meta::CPAN
=over 4
=item * PerlSetVar JumpByReferer ( On | Off )
C<JumpByReferer> is a switch to work of this handler. You must write
C<On> or C<Off> (case insensitive) value to this directive. It returns
DECLINED and will not work if the directive is not set to C<On>.
=item * PerlSetVar RefererListFile FILENAME
You must write your settings to C<RefererListFile>. The file must be
readable for the user and group of settings of Apache C<User> and
C<Group> directive.
=back
=head1 SYNTAX OF RefererListFile
You should write a valid I<REGEX> from line-head. The I<REGEX> will be
tested to check it is valid, and cached on this namespace with
timestamp of the modified time. But won't be cached if the I<REGEX> is
invalid.
and write the jumping URL or C<Forbidden> behind the I<REGEX>.
If you want to write a I<REGEX> which is including some space
character, you have to quote it. If you don't quote it, the parsing of
the text is failed.
This handler will do C<internal_redirect()> if the URL is internal
of own server. And this handler will print a C<Location> header with
C<REDIRECT> status if the URL is external. The judgement of it, an
external URL is started from C<http(s)://>, or an internal URI is
started from others.
The comment line is started by C<#> character, and it will be ignored
a blank line.
=head1 NOTES
This handler applies as for the initial request, namely does not work
for sub request and internal redirect. Because the server may be
fallen into endless loop if it applies for them.
Almost every non-initial requests are had same Referer header field as
initial request. This handler calls the internal redirect, and this
handler will redirect to current URI again and again when the handler
applies for non-initial request too and the directory setting of
redirection URI is inherited the parent settings. Because this case is
inside of the effective range of the B<JumpByReferer> setting. Perhaps
your system resources are run through in an instant by the handler
when the handler works for non-initial request too. Therefore this
function (does not work for non-initial request) exists for
self-defense. There is probably no problem in this setting. But,
understand these things fully when you use this module, please.
=head1 TODO
* I should know how to use Apache::test for testing this module.
* I should know whether it's the best way to put the handler under
C<PerlAccessHandler>.
* Probably, I should study English more to write the document neatly.
=head1 SEE ALSO
mod_perl(1), Apache(3), L<Text::ParseWords>
=head1 AUTHOR
Koichi Taniguchi E<lt>taniguchi@users.sourceforge.jpE<gt>
=head1 COPYRIGHT
Copyright (c) 2003 Koichi Taniguchi. Japan. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
( run in 2.398 seconds using v1.01-cache-2.11-cpan-437f7b0c052 )