How to match "?" in the condition?

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 04 Mar 2014, 15:29

How to match "?" in the condition?

04 Mar 2014, 15:48

Hello,

now I have switched from ISAPI_Rewrite 2.x to 3.0. I have used the "SyntaxConverter" to convert my old 2.x-rule:

RewriteRule (.*/on-demand)/(.+)\?(.+) $1/on-demand.asp?$3 [I,L]

to the new 3.x-format:

RewriteRule ^(.*/on-demand)/(.+)\?(.+)$ $1/on-demand.asp?$3 [NC]

The request-URL is:

/on-demand/stream20140125-2030.pls?user=Michael

and it should be rewritten to:

/on-demand/on-demand.asp?user=Michael

But the new rule doesn't match, also not in the RegexTest.exe tool. The problem seems to be the \? in the condition, because if I chance the \? for example to \! and modify the request URL to "...pls!user=...", it is working well.

Can anybody help me?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: How to match "?" in the condition?

05 Mar 2014, 00:48

Hello,

There're several issues I can spot right away.

Code: Select all
RewriteEngine on
RewriteBase /

## /on-demand/stream20140125-2030.pls?user=Michael  -->/on-demand/on-demand.asp?user=Michael
RewriteRule ^on-demand/.+ /on-demand/on-demand.asp [NC,QSA,L]

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests