Apache2-ModProxyPerlHtml
view release on metacpan or search on metacpan
ModProxyPerlHtml.pm view on Meta::CPAN
# DirectoryIndex is not working
# AddHandler perl-script *
PerlSetVar ProxyHTMLVerbose "On"
LogLevel Info
# URL rewriting
RewriteEngine On
#RewriteLog "/var/log/apache/rewrite.log"
#RewriteLogLevel 9
# Add ending '/' if not provided
RewriteCond %{REQUEST_URI} ^/mail$
RewriteRule ^/(.*)$ /$1/ [R]
RewriteCond %{REQUEST_URI} ^/planet$
RewriteRule ^/(.*)$ /$1/ [R]
# Add full path to the CGI to bypass the index.html redirect that may fail
RewriteCond %{REQUEST_URI} ^/calendar/$
RewriteRule ^/(.*)/$ /$1/cgi-bin/wcal.pl [R]
RewriteCond %{REQUEST_URI} ^/calendar$
RewriteRule ^/(.*)$ /$1/cgi-bin/wcal.pl [R]
<Location /webmail/>
ProxyPassReverse /
PerlAddVar ProxyHTMLURLMap "/ /webmail/"
PerlAddVar ProxyHTMLURLMap "http://webmail.domain.com /webmail"
# Use this to disable compressed HTTP
#RequestHeader unset Accept-Encoding
</Location>
<Location /webcal/>
ProxyPassReverse /
PerlAddVar ProxyHTMLURLMap "/ /webcal/"
PerlAddVar ProxyHTMLURLMap "http://webcal.domain.com /webcal"
</Location>
<Location /intranet/>
ProxyPassReverse /
PerlAddVar ProxyHTMLURLMap "/ /intranet/"
PerlAddVar ProxyHTMLURLMap "http://intranet.domain.com /intranet"
# Rewrite links that give access to the two previous location
PerlAddVar ProxyHTMLURLMap "/intranet/webmail /webmail"
PerlAddVar ProxyHTMLURLMap "/intranet/webcal /webcal"
</Location>
This gives access two a webmail and webcal application hosted internally to all
authentified users through their own Internet acces. There's also one acces to
an Intranet portal that have links to the webcal and webmail application. Those
links must be rewritten twice to works.
=head1 ROT13 obfuscation
Some links can be obfucated to be hidden from google or other robots. To enable
encode/decode of those links you can use the ProxyHTMLRot13Links directive as
follow:
PerlAddVar ProxyHTMLRot13Links All
All links in the page will be decoded before being rewritten and re-encoded.
If obfuscation occurs on some attributs only you can set the value as a pair
of element:attribut where the decoding/encoding must be applied. For example:
PerlAddVar ProxyHTMLRot13Links a:data-href
PerlAddVar ProxyHTMLRot13Links a:href
=head1 BUGS
Apache2::ModProxyPerlHtml is still under development and is pretty
stable. Please send me email to submit bug reports or feature
requests.
=head1 COPYRIGHT
Copyright (c) 2005-2022 - Gilles Darold
All rights reserved. This program is free software; you may redistribute
it and/or modify it under the same terms as Perl itself.
=head1 AUTHOR
Created and maintained by :
Gilles Darold
<gilles at darold dot net>
( run in 0.566 second using v1.01-cache-2.11-cpan-4ab04211f4c )