Apache2-SSI
view release on metacpan or search on metacpan
:
See [Apache
documentation](https://httpd.apache.org/docs/current/en/mod/mod_include.html#page-header){.perl-module}
and [this page
too](https://httpd.apache.org/docs/current/en/expr.html#page-header){.perl-module}
for more information.
expressions
-----------
There is reasonable, but limited support for Apache expressions. For
example, the followings are supported
In the examples below, we use the variable `QUERY_STRING`, but you can
use any other variable of course.
The regular expression are the ones
[PCRE](http://www.pcre.org/){.perl-module} compliant, so your perl
regular expressions should work.
<!--#if expr="$QUERY_STRING = 'something'" -->
<!--#if expr="v('QUERY_STRING') = 'something'" -->
<!--#if expr="%{QUERY_STRING} = 'something'" -->
<!--#if expr="$QUERY_STRING = /^something/" -->
<!--#if expr="$QUERY_STRING == /^something/" -->
# works also with eq, ne, lt, le, gt and ge
<!--#if expr="9 gt 3" -->
<!--#if expr="9 -gt 3" -->
# Other operators work too, namely == != < <= > >= =~ !~
<!--#if expr="9 > 3" -->
<!--#if expr="9 !> 3" -->
<!--#if expr="9 !gt 3" -->
# Checks the remote ip is part of this subnet
<!--#if expr="-R 192.168.2.0/24" -->
<!--#if expr="192.168.2.10 -R 192.168.2.0/24" -->
<!--#if expr="192.168.2.10 -ipmatch 192.168.2.0/24" -->
# Checks if variable is non-empty
<!--#if expr="-n $some_variable" -->
# Checks if variable is empty
<!--#if expr="-z $some_variable" -->
# Checks if the visitor can access the uri /restricted/uri
<!--#if expr="-A /restricted/uri" -->
For subnet checks, this uses
[Net::Subnet](https://metacpan.org/pod/Net::Subnet){.perl-module}
Expressions that would not work outside of Apache, i.e. it will return
an empty string:
<!--#expr="%{HTTP:X-example-header} in { 'foo', 'bar', 'baz' }" -->
See [Apache
documentation](http://httpd.apache.org/docs/2.4/en/expr.html){.perl-module}
for more information.
CREDITS
=======
Credits to Ken Williams for his implementation of
[Apache::SSI](https://metacpan.org/pod/Apache::SSI){.perl-module} from
which I borrowed some code.
AUTHOR
======
Jacques Deguest \<`jack@deguest.jp`{classes="ARRAY(0x564839326528)"}\>
CPAN ID: jdeguest
<https://gitlab.com/jackdeguest/Apache2-SSI>
SEE ALSO
========
[Apache2::SSI::File](https://metacpan.org/pod/Apache2::SSI::File){.perl-module},
[Apache2::SSI::Finfo](https://metacpan.org/pod/Apache2::SSI::Finfo){.perl-module},
[Apache2::SSI::Notes](https://metacpan.org/pod/Apache2::SSI::Notes){.perl-module},
[Apache2::SSI::URI](https://metacpan.org/pod/Apache2::SSI::URI){.perl-module},
[Apache2::SSI::SharedMem](https://metacpan.org/pod/Apache2::SSI::SharedMem){.perl-module}
and
[Apache2::SSI::SemStat](https://metacpan.org/pod/Apache2::SSI::SemStat){.perl-module}
mod\_include, mod\_perl(3),
[Apache::SSI](https://metacpan.org/pod/Apache::SSI){.perl-module},
<https://httpd.apache.org/docs/current/en/mod/mod_include.html>,
<https://httpd.apache.org/docs/current/en/howto/ssi.html>,
<https://httpd.apache.org/docs/current/en/expr.html>
<https://perl.apache.org/docs/2.0/user/handlers/filters.html#C_PerlOutputFilterHandler_>
COPYRIGHT & LICENSE
===================
Copyright (c) 2020-2021 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated
files under the same terms as Perl itself.
( run in 0.593 second using v1.01-cache-2.11-cpan-39bf76dae61 )