+ in URL rewrite, version 3

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 11
Joined: 13 Aug 2012, 18:17

+ in URL rewrite, version 3

13 Aug 2012, 18:23

Hello,

I am having issues with my rewrite rule. If a URL is requested that has a +, it will issue a 404

I saw a write up on a newer version, but not for version 3.

Below is my rewrite code

RewriteRule ^light-bulb/(.+) moreinfo.int?itemno=$1 [NC,L]

#RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} ^itemno=(.+)$ [NC]
RewriteRule ^moreinfo\.int$ light-bulb/%1? [NC,R=301]

How can I edit my rule to allow for a rewrite if the url contains +

TIA

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

Re: + in URL rewrite, version 3

14 Aug 2012, 08:04

ISAPI_Rewrite actually loves '+' signs. It's IIS that restrics this character.
Please, see the following article to resolve the issue - http://www.helicontech.com/articles/plus-sign-in-iis7/

Regards
Andrew

User avatar
Posts: 11
Joined: 13 Aug 2012, 18:17

Re: + in URL rewrite, version 3

14 Aug 2012, 12:32

Hi Andrew,

Thanks for the fast response! Sorry I sorta messed up in my original post.

I did see that article to resolve the issue in IIS7, I actually am running IIS 6.0 and I experience the problem. Do you have a work around you can suggest in IIS 6.0 ?

TIA

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

Re: + in URL rewrite, version 3

15 Aug 2012, 05:31

There's a plugin called URLScan, that usually messes this up.
The best way is to see the rewrite.log for the testing request. Logging issues described in FAQ

Regards
Andrew

User avatar
Posts: 11
Joined: 13 Aug 2012, 18:17

Re: + in URL rewrite, version 3

15 Aug 2012, 11:50

Hi Andrew

I made the following change in my urlscan ini file

[AlwaysAllowedQueryStrings]

;

; Query strings listed here will always be explicitly allowed by

; UrlScan and will bypass all query string based checks.

+ ; Allow Double Escape

I still receive the 404

Any other suggestions? The FAQ only pertains to IIS 7 which I am not running

TIA

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

Re: + in URL rewrite, version 3

16 Aug 2012, 04:22

So you do have URLScan... the source is identified. I can't tell you what tweaks it needs, as our customers have never given a feedback on their settings. But we know it's there.

I provided you with a FAQ(which is universal, regardless of IIS version) to see how to enable logging, so that you'd run a testing request and provide us with the rewrite.log

regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 22 guests