Apache RewriteRule and slashes (%2F)

apache-2.2mod-rewrite

I have the following RewriteRule:

RewriteRule ^like/(.+)$ ask.php/$1

Which works just fine for requests like:

/like/someting+here/something+else

But for requests where one of the path parts contains an escaped slash (%2F), the server spits out a 404 Not Found error:

/like/one%2Ftwo+things/

Is there any way to fix this? I tried both [B] and [NE] flags (separate and together) but nothing worked.

Edit: I also tried:

RewriteRule ^like/ ask.php
# or
RewriteRule ^like/(.*) ask.php

So that it doesn't necessarily have to match the slash. It's still not working.

Best Answer

Apache directive helped me

AllowEncodedSlashes On  
Related Topic