From 540105b4935b33f9805206bf78a143f778292418 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 2 May 2017 22:28:37 +0200 Subject: [PATCH] Add redirect for more old query string URLs fixes https://github.com/Debian/debiman/issues/78 --- .../templates/static-mirroring/vhost/manpages.debian.org.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/roles/templates/static-mirroring/vhost/manpages.debian.org.erb b/modules/roles/templates/static-mirroring/vhost/manpages.debian.org.erb index 103b8f107..8305ca6f7 100644 --- a/modules/roles/templates/static-mirroring/vhost/manpages.debian.org.erb +++ b/modules/roles/templates/static-mirroring/vhost/manpages.debian.org.erb @@ -13,6 +13,11 @@ RewriteMap manpagesall dbm:/srv/static.debian.org/mirrors/manpages.debian.org/cur/rwmap.dbm RewriteMap lc int:tolower + # Redirect old CGI paths (without CGI file name), keeping at least the + # manpage (the other parameters are left out for simplicity). + RewriteCond %{QUERY_STRING} (?:.*(?:^|&))query=([^&]+) + RewriteRule ^/?$ /%1 [redirect=307,qsdiscard,last] + # URLs which end in a slash do not need to be rewritten RewriteRule /$ - [last] -- 2.20.1