File: D:/bin/iirf/tests/transformurlsegmentstoqueryparams/IIRF.ini
# IsapiRewrite4.ini
#
# example ini file
#
# Fri, 11 May 2007 12:28
#
RewriteLogLevel 5
# -------------------------------------------------------
# This rule shows how to transform a URL into a query string, in one go.
# This rule specifically disallows any incoming URL that begins with "controller.jsp" or with "inc"
RewriteRule ^/(?!controller.jsp)(?!web)(?!inc)(?!a)(.+)$ /controller.jsp?v=$1 [L]
# -------------------------------------------------------
# This rule shows how to transform a URL into a query string,
# breaking it into pieces. The first segment is placed into the first
# query param, and the remainder in a different param.
# This rule applies only when the first segment in the URL
# begins with the letter a. [via (a[^\?\/]*)]
# As above, this rule specifically disallows any incoming URL
# that begins with "controller.jsp" [ via (?!controller.jsp)] or
# with "inc" [ via (?!inc)].
RewriteRule ^/(?!controller.jsp)(?!web)(?!inc)(a[^\?\/]*)/([^\?]+)$ /controller.jsp?page=$1&v=$2 [L]
# -------------------------------------------------------
# This set of rules shows how to transform a URL into a query string.
# There are three possibilities: the requested URL can have one, two or three segments.
# There is a distinct rule for each case.
# one segment
RewriteRule /web/([^\/]+)/$ /content-web.aspx?country=$1 [L]
# two segments
RewriteRule /web/([^\/]+)/([^\/]+)/$ /content-web.aspx?country=$1&city=$2 [L]
# three segments
RewriteRule /web/([^\/]+)/([^\/]+)/([^\/]+)/$ /content-web.aspx?country=$1&city=$2&area=$3 [L]
#add a trailing slash when there is no query string (use a negative lookbehind)
RewriteRule /web/(.+)(?<!\/)$ /web/$1/