This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: $10 is not working (Topic Closed Topic Closed) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
lastcowboy
Newbie
Newbie


Joined: 13 March 2008
Online Status: Offline
Posts: 13
Posted: 08 September 2008 at 5:22am | IP Logged  

Hi i have a rule like this:

RewriteRule ^\/s2s/shops\/search\/pr\/([a-zA-Z0-9.-]+)-([a-zA-Z0-9]+)\/c\/([a-zA-Z0-9.-]+)-([a-zA-Z0-9]+)\/p\/([a-zA-Z0-9.-]+)-([a-zA-Z0-9]+)\/pri\/([a-zA-Z0-9.-]+)-([a-zA-Z0-9]+)\/Page-([0-9]+)\/sort\/(name-asc|name-desc|reviews-asc|reviews-desc|overall-asc|overall-desc|r1-asc|r1-desc|r2-asc|r2-desc|r3-asc|r3-desc|r4-asc|r4-desc)([/]*)$ /s2s/searchshop.aspx?pr=$2&c=$4&p=$6&pri=$8&Page=$9&sort=$10 [NC,L]


but i cannot get the $10 even though it appears to be working in the regexp test

i keep getting the $1 appended with a zero.

Please advise.
Thank you.


Back to Top View lastcowboy's Profile Search for other posts by lastcowboy
 
Yaroslav
Admin Group
Admin Group


Joined: 15 August 2002
Online Status: Offline
Posts: 6521
Posted: 08 September 2008 at 5:56am | IP Logged  

ISAPI_Rewrite 3 only supports 1-9 submatches. You may try to concatinate some submatches or not to use some matches that are not needed and use non marking parenthes instead - (?:...)

__________________
Yaroslav Govorunov,
Helicon Tech
Back to Top View Yaroslav's Profile Search for other posts by Yaroslav Visit Yaroslav's Homepage
 
anthony
Newbie
Newbie


Joined: 24 March 2009
Online Status: Offline
Posts: 2
Posted: 24 March 2009 at 12:07pm | IP Logged  

Hi

I'm having the same issue. I need to handle several dozen parameters and I've already used non-marking parenthes where I can. How can I achieve this with your tool?

Thanks

Back to Top View anthony's Profile Search for other posts by anthony
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 8119
Posted: 24 March 2009 at 12:13pm | IP Logged  

Possible solutions are:
1) Split a single rule into two or more rules each using less then 10 submatches.
2) Use ISAPI_Rewrite 2. It can handle upto 99 submatches.
Back to Top View Lexey's Profile Search for other posts by Lexey
 
anthony
Newbie
Newbie


Joined: 24 March 2009
Online Status: Offline
Posts: 2
Posted: 24 March 2009 at 12:27pm | IP Logged  

Hi

Thanks for your very quick response. I'm not sure how to split the rule in the way you suggest. Please can you explain how I should do this with the following rule?

# Convert "availability/*startdate/31-12-2009/*nights/14/*country/GBR/region/MAN/area/RAD/sleeps/7/proptype/C/features/CSV/cur/GBP/maxprice/1234.56"

# to "search.aspx?func=search&country=GBR&region=MAN&area=RAD&sleeps=7&proptype=C&features=CSV&cur=GBP&maxprice=1234.56"

RewriteRule ^search/startdate/(\d{2}-\d{2}-\d{4}?)/nights/(\d+?)/country/(\w+?)(?:/region/(\w+))(?:/area/(\w+))(?:/sleeps/(\d+))(?:/proptype/(\w))(?:/features/(.+))(?:/cur/(\w+))(?:/maxprice/([0-9]*\.?[0-9]+))?/?$ search.aspx?func=search&startdate=$1&nights=$2&country=$3?4&region=$4?5&area=$5?6&sleeps=$6?7&proptype=$7?8&features=$8?9&cur=$9?10&maxprice=$10 [NC,LP]

Many thanks

Back to Top View anthony's Profile Search for other posts by anthony
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 8119
Posted: 24 March 2009 at 4:58pm | IP Logged  

Try this:

RewriteRule ^(search/startdate/\d{2}-\d{2}-\d{4}/nights/\d+/country/\w+/region/\w+/area/\w+)/sleeps/(\d+)/proptype/(\w)/features/([^/]+)/cur/(\w+)(?:/maxprice/((?:\d*\.)?\d+))?/?$ $1?sleeps=$2&proptype=$3&features=$4&cur=$5?6&maxprice=$6 [NC]

RewriteRule ^search/startdate/(\d{2}-\d{2}-\d{4})/nights/(\d+)/country/(\w+)/region/(\w+)/area/(\w+)$
search.aspx?func=search&startdate=$1&nights=$2&country=$3®ion=$4&area=$5 [NC,QSA,L]
Back to Top View Lexey's Profile Search for other posts by Lexey
 

Sorry, you can NOT post a reply.
This topic is closed.

  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