This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Looping
Message |

Joined: 08 November 2011
Posts: 2
Posted: 08 November 2011 at 4:41am

I cannot figure this out and hope that someone can help please.

I have some landing pages called:


They are run from a template, and I need to capture the london place variable from the URL and give this to the page in order to serve up the correct information each time.

The page it serves to is:


So I have a working rule, thus:

RewriteRule ^(.*)/properties.asp /template.asp?key=$1 [NC,L]

However, on each page there are options to change page, sort, restrict by price range, type of property and location. This is where I run into problems with understanding looping.

The URL of the page might look like this when someone refines their search or changes page number:

e.g. /template.asp?key=london&PageNo=3&Sort=DESC&Type=Apartment&Budget=250000-500000


e.g. /template.asp?key=london&PageNo=3


e.g. /template.asp?key=london&Sort=ASC&Type=Apartment

So, I need to loop everything after the first variable to tell the template page what to display.

This is as far as I have got, but, as I'm not really understanding Regular Expressions yet, I've got myself in a bit of a hole.

RewriteRule ^(.*)(\?[^/]*)?/([^/]*)/([^/]*)(.*)/properties\.asp /template.asp?key=$1(?2$2&:\?)$3=$4$5 [NS,I]

Most of this is taken from Helicon's example page.

Can anyone help please??

Edited by V8S - 08 November 2011 at 4:42am
Back to Top

Joined: 08 November 2011
Posts: 2
Posted: 09 November 2011 at 4:16am


I really need some help if possible.
Back to Top

Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 11 November 2011 at 5:47am


To start with:
- in case you want to match everything between '/' and '/' use ([^/]+);
- please, try using '$' as the end of the pattern and try escaping '.' as in following:

RewriteRule ^([^/]+)/properties\.asp$ /template.asp?key=$1 [NC,L]
RewriteRule ^([^/]+)/PageNo/(\d+)/properties\.asp$ /template.asp?key=$1&PageNo=$2 [NC,L]

Back to Top

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version