Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Can’t get this to work (Topic Closed Topic Closed) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
petesp
Newbie
Newbie


Joined: 01 August 2007
Online Status: Offline
Posts: 6
Posted: 01 August 2007 at 4:56am | IP Logged  

Hi everyone.

I have a search page wich I'm tryring to rewrite. The search page can have one or more parameters, and i would like the rewrite to reflect this.

This is what I've come up with so far:

Rule1: RewriteRule /search/(.*)/ /search.aspx?searchstring=$1 [I,L]
Should result in the following url: www.mydomain.com/search/thesearchstring/

Rule 2: RewriteRule /search/(.*)/page(\d+)\.htm /search.aspx\?searchstring=$1&page=$2 [I,L]
Should result in the following url: www.mydomain.com/search/thesearchstring/page3.htm

Rule 3: RewriteRule /search/(.*)/(.*)/ /search.aspx\?searchstring=$1&location=$2 [I,L]
Should result in the following url: www.mydomain.com/search/thesearchstring/thelocation/

Rule 4: RewriteRule /search/(.*)/(.*)/page(\d+)\.htm /search.aspx\?searchstring=$1&location=$2&page=$3 [I,L]
Should result in the following url: www.mydomain.com/search/thesearchstring/thelocation/page2.htm

My problem is that rules 3 and 4 doesn't seem to work.

Any help at all would be greatly appriciated.

Back to Top View petesp's Profile Search for other posts by petesp
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10483
Posted: 01 August 2007 at 5:12am | IP Logged  

First, I've made 2 rules out of your 4:

RewriteRule /search/(.*)/(page(\d+)\.htm)? /search.aspx\?searchstring=$1(?2&page=$2) [I,L]

RewriteRule /search/(.*)/(.*)/(page(\d+)\.htm)? /search.aspx\?searchstring=$1&location=$2(?3&page=$3) [I,L]

And they should work fine.
If they doesn't work, please give your testing urls.


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


Joined: 01 August 2007
Online Status: Offline
Posts: 6
Posted: 02 August 2007 at 4:29am | IP Logged  

Thank you! That did the trick
Back to Top View petesp's Profile Search for other posts by petesp
 

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