This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: $10 is not working (Topic Closed Topic Closed)
Author
Message |
lastcowboy
Newbie


Joined: 13 March 2008
Posts: 13
Posted: 08 September 2008 at 5:22am  

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
 
Yaroslav
Admin Group


Joined: 15 August 2002
Posts: 6520
Posted: 08 September 2008 at 5:56am  

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 Visit Yaroslav's Homepage
 
anthony
Newbie


Joined: 24 March 2009
Posts: 2
Posted: 24 March 2009 at 12:07pm  

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
 
Lexey
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Posts: 8119
Posted: 24 March 2009 at 12:13pm  

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
 
anthony
Newbie


Joined: 24 March 2009
Posts: 2
Posted: 24 March 2009 at 12:27pm  

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
 
Lexey
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Posts: 8119
Posted: 24 March 2009 at 4:58pm  

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
 

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