Thanh Trung
Thanh Trung

Reputation: 3804

Why my regular expression doesn't match this?

Please help me with this problem. This is my htaccess rule :

RewriteCond %{REQUEST_METHOD} ^(GET)
RewriteRule ^ws/([^/]+)/([^/]+)/([A-Za-z]+)(&.+)?$   index.php?module=ws&wsType=$1&wsRessource=$2&wsAction=$3$4 [L,QSA]

This is what I want to match

ws/rest/user/get&criteria%5Befezf%5D=%2Ftot%2F&output=dump&compress=&session_id=cb932jrjakosubljl16loecbl1&api_key=a94a8fe5ccb19ba61c4c0873d391e987982fbbd3

The problem is around %2Ftot%2F. If I remove %2F (which is a slash / ), rewrite rule works

Upvotes: 1

Views: 66

Answers (1)

Andrew Cheong
Andrew Cheong

Reputation: 30273

Add the [B] flag, i.e. [L,QSA,B], or add

AllowEncodedSlashes On

to Apache, or use %252F instead of %2F.

Upvotes: 3

Related Questions