Unable to match% 2F in mod_rewrite

I have a set of rewrite rules (in .htaccess) something like this:

RewriteRule ^list/vendor/(.*)$ list.php?vendor=$1 RewriteRule ^list/product/(.*)$ list.php?product=$1 RewriteRule ^list/(.*)$ list.php?search=$1 

(I don't think the first two relate to my question, though).

When I type myserver.com/list/foo%2Cbar or even myserver.com/list/foo/bar , I get the expected results: list.php is called with foo,bar and foo/bar in $_GET['search'] .

But if I type myserver.com/list/foo%2Fbar , this rule does not seem to match! Instead, I get error 404. What can I do here? Apache 2.2.14, if that matters.

(I tried in Firefox and Chrome, the same results - but, of course, it could be a browser).

+6
url-rewriting mod-rewrite apache2
Sep 25 2018-11-11T00:
source share
1 answer

Bah, I found it ... a version of Apache AllowEncodedSlashes that cannot be installed for a directory or from .htaccess and is disabled by default.

Build time, if I can’t get the hosting guys to enable it on my virtual server.

+14
Sep 25 2018-11-11T00:
source share



All Articles