# Include this file with:
#
#   Include /etc/request-tracker3.4/apache2-modperl2.conf
#
# into your Apache configuration file, in a virtual host section
#
# You will need to enable the Apache modules: perl, actions, rewrite
#
# The best place for this in the Debian Apache2 default situation is
# near the end of the VirtualHost section in the file
# /etc/apache2/sites-available/default.

# You might want to enable this line
# AddDefaultCharset UTF-8

PerlModule Apache2::compat
PerlModule Apache::DBI
PerlRequire /usr/share/request-tracker3.4/libexec/webmux.pl
PerlSetVar MasonArgsMethod CGI

# Normally a request for a directory will be rewritten to index.html
# (or similar) by default if that file exists. For some reason this does
# not happen with the handler being set to perl-script. We thus have to
# do it ourselves using mod_rewrite.

RewriteEngine on

# You might need to alter these two lines which refer to /rt to match
# whatever base URL you are using for your rt3 site.

RewriteRule ^/rt$ /rt/
RewriteRule ^/rt/(.*)$ /usr/share/request-tracker3.4/html/$1
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(/usr/share/request-tracker3.4/html.*)/$ $1/index.html

# We need this to prevent requests for images being sent through to
# the RT::Mason handler.

<Directory /usr/share/request-tracker3.4/html/NoAuth/images>
  SetHandler default-handler
</Directory>

<Directory /usr/share/request-tracker3.4/html>
  SetHandler perl-script
  PerlHandler RT::Mason
</Directory>

