This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Rule not working as expected anymore
Message |

Joined: 01 September 2011
Posts: 1
Posted: 01 September 2011 at 8:41am

I have the following rule:

RewriteRule ^/.*/products/(.*)\?*(.*)$ /products.asp?ID=$1&$2

Which should be matching the following two types of URLs:

/some-description/products/100 --> /products.asp?ID=100&

/some-description/products/100?X=Y --> /products.asp?ID=100&X=Y

It does match the top example (without the ?), but the second example always matches as:


as it is setting the first matching group ($1) to "100?X=Y" and not matching the ?.

I've tried lazy match as well with no change. I would be very appreciative if someone could point me in the right direction.

Back to Top
Admin Group

Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 02 September 2011 at 2:04am

Here's how it should be:

RewriteRule /.*/products/([^?]*)(?:\?(.*))? /products.asp?ID=$1&$2 [I,L]

Back to Top

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum