This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Rewrite Rule and GeoPath Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
durabo
Newbie
Newbie


Joined: 25 February 2010
Online Status: Offline
Posts: 19
Posted: 09 April 2010 at 10:22am | IP Logged Quote durabo

many thanks and sorry Anton,

but i had to reverse the URL and i modify pattern:

1 - geopath
2 - type (optional)
3 - month (optional)
4 - page number (optional)

RewriteRule ^it/events/(.+?)(?:/([^/]+))(?:/(january|february|march|april))?(?:/pag-([^/]+))$ /it/events/events.asp?(?3month=$3&)&geo=$1(?2&type=$2)&pg=$4 [NC]

(for convenience i stop months in april... )

the debug:

1 - it/events/state/region/city/type/april/pag-2 work

2 - it/events/state/region/city/april/pag-2 don't work... city is separated

$0: it/events/state/region/city/april/pag-2
$1: state/region
$2: city
$3: april
$4: 2



Edited by durabo - 09 April 2010 at 10:23am
Back to Top View durabo's Profile Search for other posts by durabo
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 09 April 2010 at 10:47am | IP Logged Quote Anton

Maybe the nubmer of values for "type" parameter is finite and we can list them as well as "month"? This will help a lot, as with such number
of optional parameters it's really difficult to build a generic rule.

It will be smth like this:

RewriteRule ^it/events/(.+?)(?:/(type|type1|type2|etc))?(?:/(january|february|march|april))?(?:/pag-([^/]+))$ /it/events/events.asp?geo=$1(?
2&type=$2)(?3&month=$3)(?4&pg=$4) [NC]

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


Joined: 25 February 2010
Online Status: Offline
Posts: 19
Posted: 09 April 2010 at 11:18am | IP Logged Quote durabo

I thought the same thing ... are only 14 values
Apply your pattern and will be updated.

May I ask what software you use to test the patterns?
i use regbuddy but your pattern is not recognized

See you soon
Back to Top View durabo's Profile Search for other posts by durabo
 
durabo
Newbie
Newbie


Joined: 25 February 2010
Online Status: Offline
Posts: 19
Posted: 10 April 2010 at 9:56am | IP Logged Quote durabo

Anton wrote:
Maybe the nubmer of values for "type"
parameter is finite and we can list them as well as
"month"? This will help a lot, as with such number
of optional parameters it's really difficult to build a
generic rule.

It will be smth like this:

RewriteRule ^it/events/(.+?)(?:/(type|type1|type2|etc))?
(?:/(january|february|march|april))?(?:/pag-([^/]+))$
/it/events/events.asp?geo=$1(?
2&type=$2)(?3&month=$3)(?4&pg=$4) [NC]


Good Work Anton... i add "?/?" at then end for trailing
slash...

thanks and many thanks...
Back to Top View durabo's Profile Search for other posts by durabo
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 12 April 2010 at 3:31am | IP Logged Quote Anton

You are always welcome.

P.S. As for the testing software, I use the RegexTest utility supplied with ISAPI_Rewrite and available in its installation folder.

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


Joined: 25 February 2010
Online Status: Offline
Posts: 19
Posted: 12 April 2010 at 3:33am | IP Logged Quote durabo

I also...
Back to Top View durabo's Profile Search for other posts by durabo
 

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

<< Prev Page of 2
  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 can vote in polls in this forum