Unable to get QUERY_STRING to rewrite

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 05 Mar 2013, 19:07

Unable to get QUERY_STRING to rewrite

05 Mar 2013, 19:37

I'm using version 3,1,0,89 - It's the lite version, although I do use the paying version as well.

I'm trying to rewrite a url with a query string:

http://www.example.com/r4353/ford-fiesta/photos?p=sdf653_tre3

where sdf653_tre3 is a photoID, 4353 is the carID and ford-fiesta is the carName

I'd like the url above to call my script:

/include/index.asp?&id=4353&rurl=ford-fiesta&type=photos&p=sdf653_sdf3

I'm using this rule:

RewriteCond %{QUERY_STRING} ^p=(.*)$ [I]
RewriteRule ^/r([0-9]+)/([^/.]+)/photos$ /include/index.asp?id=$1&rurl=$2&type=photos&p=%1? [L]

I'm unable to get this rule to work. Can anybody see what I'm doing wrong? Thank you in advance!

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

Re: Unable to get QUERY_STRING to rewrite

06 Mar 2013, 02:59

Hello,

Looks like you know what you're doing. The rule looks correct.
Lets take a look at the rewrite.log. Logging issues are described in FAQ - http://www.helicontech.com/forum/10648-FAQ.html

Regards
Andrew

User avatar
Posts: 3
Joined: 05 Mar 2013, 19:07

Re: Unable to get QUERY_STRING to rewrite

06 Mar 2013, 08:42

Thanks for the quick reply Andrew.

My error log:

[6/03/2013 22:34:02] Unknown expression in the file C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf, on the line #19: RewriteCond %{QUERY_STRING} ^p=(.*)$ [I]
[6/03/2013 22:34:02] C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf - Loaded successfully

My redirect log:

...init rewrite engine with requested uri /r4353/ford-fiesta/photos?p=sdf653_tre3
...
127.0.0.1 127.0.0.1 Wed, 06-Mar-2013 22:36:07 GMT [.../sid#1][rid#170482600/initial] (1) Rewrite URL to >> /include/index.asp?&id=4353&rurl=ford-fiesta&type=photos&p=
127.0.0.1 127.0.0.1 Wed, 06-Mar-2013 22:36:07 GMT [.../sid#1][rid#170482600/initial] (2) rewrite '/r4353/ford-fiesta/photos' -> '/include/index.asp?&id=4353&rurl=ford-fiesta&type=photos&p='
127.0.0.1 127.0.0.1 Wed, 06-Mar-2013 22:36:07 GMT [.../sid#1][rid#170482600/initial] (2) internal redirect with /include/index.asp?&id=4353&rurl=ford-fiesta&type=photos&p= [INTERNAL REDIRECT]

It's not seeing the p= query_string, even if I use ^p=(\d+)$ to remove the error in the error log.

Maybe the product doesn't support what I'm trying to do?

thanks in advance!

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

Re: Unable to get QUERY_STRING to rewrite

06 Mar 2013, 10:14

ISAPI_Rewrite does support what you're trying to do.

The problem is in condition. The condition is supposed to work according to the limitations of the LITE version - http://www.helicontech.com/isapi_rewrite/doc/litever.htm
The problem in condition is probably related to the [I]-flag. [I]-flag belongs to v2, and was replaced by [NC] in version 3.

Regards
Andrew

User avatar
Posts: 3
Joined: 05 Mar 2013, 19:07

Re: Unable to get QUERY_STRING to rewrite

07 Mar 2013, 18:53

OMG!

Thanks Andrew! That fixed my problem! I replaced I with NC, and it worked! Thank you very much for your help!

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 3 guests