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
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Rule not working as expected anymore Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
bobbo11
Newbie
Newbie


Joined: 01 September 2011
Online Status: Offline
Posts: 1
Posted: 01 September 2011 at 8:41am | IP Logged Quote bobbo11

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:

/products.asp?ID=100?X=Y

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 View bobbo11's Profile Search for other posts by bobbo11
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 02 September 2011 at 2:04am | IP Logged Quote Anton

Here's how it should be:

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

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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