David Cook
181125242c
Historically, we have used Apache rewrite directives to strip query parameters with no arguments from the query string (e.g. PARAM=&), and then redirect to the new URL. However, this slows down user activity, and depending on your HTTPS and proxy setup can cause suboptimal HTTP downgrades and upgrades. Test Plan: 0) Apply patch 1) Build Debian package 2) Install Debian package and reload Apache 3) Open developer tools on your favourite browser 4) Go to Network tab in developer tools 5) Go to /cgi-bin/koha/opac-main.pl 6) Search for "test" 7) Note a 200 status for "opac-search.pl?idx=&q=test" If you got a 302 status for "opac-search.pl?idx=&q=test" followed by a 200 status for "opac-search.pl?q=test", you will know that your Apache configuration wasn't updated. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
37 lines
1.3 KiB
Text
37 lines
1.3 KiB
Text
# Apache configuration settings that are shared for every Koha instance.
|
|
# This file contains settings for the OPAC site.
|
|
#
|
|
# This file should be included from an instance's
|
|
# /etc/apache2/site-available file, from within the VirtualHost section
|
|
# for OPAC.
|
|
|
|
DocumentRoot /usr/share/koha/opac/htdocs
|
|
|
|
ScriptAlias /cgi-bin/koha/ "/usr/share/koha/opac/cgi-bin/opac/"
|
|
ScriptAlias /index.html "/usr/share/koha/opac/cgi-bin/opac/opac-main.pl"
|
|
ScriptAlias /search "/usr/share/koha/opac/cgi-bin/opac/opac-search.pl"
|
|
ScriptAlias /opac-search.pl "/usr/share/koha/opac/cgi-bin/opac/opac-search.pl"
|
|
|
|
RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
|
|
RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
|
|
RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
|
|
RewriteRule ^(.*)_[0-9]{2}\.[0-9]{7}\.(js|css)$ $1.$2 [L]
|
|
|
|
<IfVersion >= 2.4>
|
|
AliasMatch "^/sitemap(.*)" "/var/lib/koha/${instance}/sitemap/sitemap$1"
|
|
<Directory "/var/lib/koha/${instance}/sitemap">
|
|
Require all granted
|
|
</Directory>
|
|
</IfVersion>
|
|
|
|
Alias "/api" "/usr/share/koha/api"
|
|
<Directory "/usr/share/koha/api">
|
|
Options +ExecCGI +FollowSymlinks
|
|
AddHandler cgi-script .pl
|
|
|
|
SetEnv MOJO_MODE "production"
|
|
|
|
RewriteBase /api/
|
|
RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl
|
|
RewriteRule ^(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L]
|
|
</Directory>
|