In Apache config koha-httpd.conf, URL-rewriting is enabled and does not allow to disable mod_rewrite. Also, first rewriting rule "RewriteRule (.+) $1?%1%2 [N,R,NE]" is enabled by default. This rule rewrites nearly every URL. I propose to comment it in sources so that is must be intentionally enabled.
Created attachment 15586 [details] [review] Proposed patch See commit comment
Could you address what the ramifications of this change would be? Do we lose any functionality?
I propose to disable first rewriting rule "RewriteRule (.+) $1?%1%2 [N,R,NE]" because we notices that it can cause some problems. For example, a library has defined some search links in OPACNav : "/cgi-bin/koha/opac-search.pl?idx=kw&idx=kw&idx=kw&limit=mc-ccode%3ADVD" (%3A means ":"). When clicking on this URL, it is rewritten and espaced characters are re-escaped : "mc-ccode%3ADVD" becomes "mc-ccode%253ADVD", witch is wrong. I've searched but I could not find what is the purpose of this rule. Does someone know ?
(In reply to comment #2) > Could you address what the ramifications of this change would be? Do we lose > any functionality? Setting rewrite conditional does not change anything. If we can find wat is the purpose of first rewrite rule, it will be disabled but only for new installs.
http://lists.koha-community.org/pipermail/koha-devel/2007-December/029821.html Considering how wrong the author of that email was about pretty much everything else, I vote for removing it (empty params are harmless, much more harmless than rewriting urls we don't need to)
Created attachment 16215 [details] [review] Bug 9683: Allow disable rewrite apache mod In Apache config koha-httpd.conf, URL-rewriting is enabled and does not allow to disable mod_rewrite. Also, first rewriting rule "RewriteRule (.+) $1?%1%2 [N,R,NE]" is enabled by default. This rule rewrites nearly every URL. I propose to comment it in sources so that is must be intentionally enabled. This patch sets rewriting options into a conditional tag. Test plan : Test OPAC and intranet with and without mod_rewrite activated. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 17151 [details] [review] Bug 9683: Allow disable rewrite apache mod In Apache config koha-httpd.conf, URL-rewriting is enabled and does not allow to disable mod_rewrite. Also, first rewriting rule "RewriteRule (.+) $1?%1%2 [N,R,NE]" is enabled by default. This rule rewrites nearly every URL. I propose to comment it in sources so that is must be intentionally enabled. This patch sets rewriting options into a conditional tag. Test plan : Test OPAC and intranet with and without mod_rewrite activated. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Mason James <mtj@kohaaloha.com>
(In reply to comment #7) > Created attachment 17151 [details] [review] [review] > Bug 9683: Allow disable rewrite apache mod > This patch sets rewriting options into a conditional tag. > > Test plan : > Test OPAC and intranet with and without mod_rewrite activated. > > Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > Signed-off-by: Mason James <mtj@kohaaloha.com> passing QA patch looks fine and works as expected
This patch has been pushed to master.
Looks like we should've commented out the following as well: RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*) In the absence of RewriteRule (.+) $1?%1%2 [N,R,NE], it's being applied to RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]. I'm opening a new bug for that though.
Also, this patch isn't implemented in the Debian Apache templates, although that doesn't apply to my current situation...