Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Can we do without prepending a folder? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ozbiz
Newbie
Newbie


Joined: 31 March 2003
Location: Australia
Online Status: Offline
Posts: 20
Posted: 24 July 2008 at 9:20am | IP Logged Quote ozbiz

Lexey, Yaroslav, Thank you guys - we have been using three of your licences since 2003 - you should get an award for the best software and best support on the internet. :)

I have this problem. (On this server we have V2.x but happy to upgrade to V3.x if it solves this issue).

We have two identical rules but we want the second rule to run if there is no match for the first rule.

This works for the first rule but breaks for the second rule.

RewriteRule ([a-z_]+)/([a-z_]+)(?:-([a-z_]*))?\.htm /fileone.asp\?one=$1\&two=$2\&three=$3 [I,O]

/variableone/two-three.htm

RewriteRule ([a-z_]+)/([a-z_]+)(?:-([a-z_]*))?\.htm /filetwo.asp\?one=$1\&two=$2\&three=$3 [I,O]

/variableone/two-three.htm

Ideally we would like the output for the second rule to be the same /variableone/two-three.htm if there is no match for variableone from the first rule. There is a reason why we have to have variableone coming from the same table for both files.

================

This works but...


RewriteRule /anynameone/([a-z_]+)/([a-z_]+)(?:-([a-z_]*))?\.htm /fileone.asp\?one=$1\&two=$2\&three=$3 [I,O]

/anynameone/variableone/two-three.htm

RewriteRule /anynametwo/([a-z_]+)/([a-z_]+)(?:-([a-z_]*))?\.htm /filetwo.asp\?one=$1\&two=$2\&three=$3 [I,O]

/anynametwo/variableone/two-three.htm

The second solution works but... Is there a way that we can do this without prepending the extra folder?

Best regards,
Jim

Edited by ozbiz - 24 July 2008 at 11:00am
Back to Top View ozbiz's Profile Search for other posts by ozbiz Visit ozbiz's Homepage
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 3934
Posted: 25 July 2008 at 4:05am | IP Logged Quote Anton

If I understand you correctly, you want the first rule to fire if say variableone value is 1..10, and the second rule should fire if say variableone value is 11..20. Right?
The only solution I can think of is using ISAPI_Rewrite3 Full with map files.
You should have two map files:
mapfile1.txt
1 1
2 2
3 3
...
10 10

mapfile2.txt
11 11
12 12
13 13
...
20 20

And the following config:
RewriteBase /
RewriteMap mapfile1 txt:mapfile1.txt
RewriteMap mapfile2 txt:mapfile2.txt
RewriteRule ^anynameone/([a-z_]+)/([a-z_]+)(?:-([a-z_]*))?\.htm$ /fileone.asp?one=${mapfile1:$1}&two=$2&three=$3 [NC,L]
RewriteRule ^anynameone/([a-z_]+)/([a-z_]+)(?:-([a-z_]*))?\.htm$ /fileone.asp?one=${mapfile2:$1}&two=$2&three=$3 [NC,L]

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


Joined: 31 March 2003
Location: Australia
Online Status: Offline
Posts: 20
Posted: 10 August 2008 at 3:02am | IP Logged Quote ozbiz

Thank you Anton.
Back to Top View ozbiz's Profile Search for other posts by ozbiz Visit ozbiz's Homepage
 

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