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 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Permalink Pattern problem
Author
Message |
MattMason
Newbie


Joined: 09 August 2011
Location: United States
Posts: 2
Posted: 09 August 2011 at 12:45pm

Not being a master of regular expressions, I need some help in my RewriteRule pattern.  Currently my rule looks like this:

RewriteRule Pneumotach-Transducer-TSD107B([^?]*)(?:\?(.*))? /ResearchNotes$1.asp\?Aid=&ANid=22&Level=4

RewriteRule Pneumotach-Transducer-TSD107B-mer([^?]*)(?:\?(.*))? /ResearchNotes$1.asp\?Aid=15&ANid=22&Level=4

RewriteRule Pneumotach-Transducer-TSD107B-gravity([^?]*)(?:\?(.*))? /ResearchNotes$1.asp\?Aid=24&ANid=22&Level=4

But these don't resolve.  Other permalinks that are dissimilar work just fine, but when the permalinks are close in the pattern, it doesnt work.  I am certain it's the pattern.  Any ideas?  Help is much appreciated!

thanks!
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 10 August 2011 at 4:09am

Please try to put the rules in the following order:

RewriteRule /Pneumotach-Transducer-TSD107B-mer([^?]*)(?:\?(.*))? /ResearchNotes$1.asp\?Aid=15&ANid=22&Level=4
RewriteRule /Pneumotach-Transducer-TSD107B-gravity([^?]*)(?:\?(.*))? /ResearchNotes$1.asp\?Aid=24&ANid=22&Level=4
RewriteRule /Pneumotach-Transducer-TSD107B([^?]*)(?:\?(.*))? /ResearchNotes$1.asp\?Aid=&ANid=22&Level=4

__________________
Regards,
Anton
Back to Top
 
MattMason
Newbie


Joined: 09 August 2011
Location: United States
Posts: 2
Posted: 10 August 2011 at 10:49am

Hi Anton -
I don't understand why this order makes more sense.  I have 50 thousand similar permalinks.  I know have them in order from longest permalink to smallest, but I still am having some problems.  Can you please give me a rule of thumb or help me understand the logic of the new order?

thanks,
Matt
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 11 August 2011 at 1:23am

Hello, Matt

With the order you initially had the first rule will get matched for the requests intended for all three rules, as it's the most generic one.
It means that whether you request
www.site.com/Pneumotach-Transducer-TSD107B-smth
or
www.site.com/Pneumotach-Transducer-TSD107B-mersmth
or
www.site.com/Pneumotach-Transducer-TSD107B-gravitysmth
the first rule will fire.
When you put them in the order I suggested the most generic rule goes last thus giving other rules a chance to get matched.
Hope I made myself clear.

__________________
Regards,
Anton
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