Isapi rewrite decodes %26 to ampersand

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 4
Joined: 28 Oct 2015, 12:35

Isapi rewrite decodes %26 to ampersand

28 Oct 2015, 13:03

Hi support,
I have a problem when %26 is found in a url

I have this rule:
RewriteRule ^/search/(.+)$ /search.aspx?$1 [NU, NC, L, QSA]

I works unless I have a %26 in $1
For example from this address:

/search/qs=b%20%26%20d?mets=b%20%26%20d

it genetates

/search.aspx?qs=b%20&%20d&mets=b%20%26%d

For querystring %26 is mantained while for $1 is transformed from %26 to &

Is there any way to leave $1 not decoded?

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Isapi rewrite decodes %26 to ampersand

02 Nov 2015, 09:20

Hello.

Try to add [O] flag:

RewriteRule ^/search/(.+)$ /search.aspx?$1 [O, NC, L, QSA]

User avatar
Posts: 4
Joined: 28 Oct 2015, 12:35

Re: Isapi rewrite decodes %26 to ampersand

03 Nov 2015, 06:06

Hello
I cannot add n(O)rmalization flag as it removes all parameters and encode the char "?".
so doing so I get /search.aspx?qs=b%20%26%20d%3Fmets=b%20%26%d
where b%20%26%20d%3Fmets=b%20%26%d is the value only for qs parameter

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Isapi rewrite decodes %26 to ampersand

03 Nov 2015, 07:32

Then what if you try [NE] flag?

User avatar
Posts: 4
Joined: 28 Oct 2015, 12:35

Re: Isapi rewrite decodes %26 to ampersand

03 Nov 2015, 07:51

No way, %26 is still decoded in &

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: Isapi rewrite decodes %26 to ampersand

03 Nov 2015, 07:59

Then we will need time to troubleshoot this.

User avatar
Posts: 3
Joined: 20 Jul 2016, 05:48

Re: Isapi rewrite decodes %26 to ampersand

03 Jul 2024, 01:04

Hello from 2024. I have exactly the same problem. Was a solution ever found?

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 3 guests