Problem with +

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 9
Joined: 27 Mar 2012, 22:41

Problem with +

29 Sep 2012, 02:58

I have the rule below which works most of the time except when productname.html includes a + such as abc+123.html, what is returned is abc 123.html - the + is converted to a space.
How can I retain the +

# This rule is to manage products when URL = http://www.domain.com/brandname/productname.html
RewriteRule /([a-z,0-9\+\-\%\_]+)/([a-z,0-9\+\-\%\_]+).html /$1/display.html\?var=$2 [I,L]

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with +

01 Oct 2012, 02:30

Please specify what version of IIS you are using. If it's IIS 7, please see this article for solution: http://www.helicontech.com/articles/plus-sign-in-iis7/

User avatar
Posts: 9
Joined: 27 Mar 2012, 22:41

Re: Problem with +

01 Oct 2012, 02:43

IIS 6

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with +

01 Oct 2012, 03:55

Hello,

Please enable logging in httpd.conf by putting

RewriteLogLevel 9

Then make the test request again and show rewrite.log records for that request.

User avatar
Posts: 9
Joined: 27 Mar 2012, 22:41

Re: Problem with +

01 Oct 2012, 04:28

Hi Anton, how do I do that, I am using v2.x

Line 15: Unrecognized string: RewriteLogLevel 9

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with +

01 Oct 2012, 06:08

Sorry, I've mixed up your version.

Please try to change your rule as follows:

RewriteRule /((?:[a-z,0-9\+\-\%\_]|\%2b)+)/((?:[a-z,0-9\+\-\%\_]|\%2b)+)\.html /$1/display.html\?var=$2 [I,L]

User avatar
Posts: 9
Joined: 27 Mar 2012, 22:41

Re: Problem with +

01 Oct 2012, 06:34

Thanks Anton

That is perfect !!!

Stuart

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 4 guests