## Depending on the webserver configuration this may not be necessary
AddHandler cgi-script .pl
RewriteEngine on
RewriteBase /
# Redirect front pages
RewriteRule ^opac$ koha/opac/cgi-bin/opac/opac-main.pl [R=permanent,L]
RewriteRule ^admin$ koha/intranet/cgi-bin/mainpage.pl [R=permanent,L]
# Redirect template requests
RewriteRule ^intranet-tmpl(.*)$ koha/intranet/htdocs/intranet-tmpl$1
[L]
RewriteRule ^opac-tmpl(.*)$ koha/opac/htdocs/opac-tmpl$1 [L]
# Redirect opac cgi requests
RewriteRule ^cgi-bin/koha/opac(.*)$ koha/opac/cgi-bin/opac/opac$1 [L]
RewriteRule ^cgi-bin/koha/sco(.*)$ koha/opac/cgi-bin/opac/sco$1 [L]
RewriteRule ^cgi-bin/koha/maintenance.pl(.*)$ koha/opac/cgi-bin/opac/
maintenance.pl$1 [L]
# Other cgi requests are intranet requests
RewriteRule ^cgi-bin/koha/(.*)$ koha/intranet/cgi-bin/$1 [L]
# Do we need this ?
RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
RewriteRule (.+) $1?%1%2 [N,R,NE]
# Koha config variables.
SetEnv KOHA_CONF "$ROOT/koha/etc/koha-conf.xml"
SetEnv PERL5LIB "$ROOT/koha/lib"