File: D:/bin/iirf/tests/modifierflags/IIRF.ini
# IsapiRewrite4.ini
#
# ini file for the ISAPI rewriter.
#
# Tests and demonstrations of modifier flags.
#
# Mon, 24 Aug 2009 06:18
#
RewriteLogLevel 3
##-------------------------------------------------------
## R = Redirect
##-------------------------------------------------------
##
## /cim
##
## should rewrite to:
##
## /about/business/index.html#cim
##
## NB: a simple rewrite to a URL that contains an anchor point
## will not work. This is because #anchors are browser-specific
## instructions. The server knows nothing about them, so
## rewriting the URL, on the server-side, to a new URL with an
## anchor reference (foo.htm#anchor) will result in a 404. If
## you use the [R] modifier, the server will issue an HTTP 302,
## which results in a browser-side redirect. the browser will
## request the new page and will advance to the anchor point
## once the full page is received from the server.
##
# Redirect to a URL with an anchor point.
RedirectRule ^/(cim|pom|erm)/{0,1}$ http://%{HTTP_HOST}/about/business/index.html#$1
# Regular Expression Note: that {0,1} is a quantifier in the
# regular expression - essentially it applies to the prior atom,
# which in this case is a slash. So it evaluates to /cim, with
# or without a trailing slash. Then the pipe characters (|) or
# essentially logical OR statements. So this regex says,
# either /cim (with or without a trailing slash)
# or /pom/
# or /erm/
# remote redirects also work
RewriteRule ^/foo$ http://remotehost/Foo [R]
# This remote redirect uses a 301 code.
RewriteRule ^/Foo$ http://otherhost/foo [R=301]
##-------------------------------------------------------
# F = Forbidden
##-------------------------------------------------------
RewriteRule ^/Forbidden$ ThisStringIsIgnored [F]
##-------------------------------------------------------
# G = Gone
##-------------------------------------------------------
RewriteRule ^/Gone ThisStringIsIgnored [G]
##-------------------------------------------------------
# NF = Not found
##-------------------------------------------------------
RewriteRule ^/ThisUrlIsNotFound ThisStringIsIgnored [NF]
##-------------------------------------------------------
# L = Last Rule
##-------------------------------------------------------
# One pass only on this URL (because of [L] flag). /OnePassOnly
# gets rewritten to /cim. Note there is a rule that *would*
# match /cim but it is never parsed for this URL, because of the
# [L] modifier flag.
RewriteRule ^/OnePassOnly /cim [L]
##-------------------------------------------------------
# I = case-Insensitive matching
##-------------------------------------------------------
# This flag tells the regular-expression pattern matcher to
# match without regard for case. There is a regular-expression
# syntax supported in PCRE (and thus in IIRF) that supports
# case- insensitive matching in a more finely-grained manner -
# the (?i) and (?-i) fragments. See the IIRF readme for more
# information. In any case, this modifier flag is also
# supported. These two rules, combined with the test URLs in
# the sampleUrls.txt file, demonstrate the capability.
RewriteRule ^/CaseInsensitive(.*)$ /caseless$1 [I]
RewriteRule ^/CaseSensitive(.*)$ /notcaseless$1
##-------------------------------------------------------
# [I,L] = case-insensitive and last-modifier
##-------------------------------------------------------
# This example combines the I and L flags.
RewriteRule ^/NoCaseChecking(.*)$ /caseINSENSITIVE$1 [I,L]
##-------------------------------------------------------
# [Q] = unsupported flag
##-------------------------------------------------------
# This example shows what happens when an unsupported modifier flag
# is used. (You get a warning in the LOG file)
RewriteRule ^/Unsupported(.*)$ /DoesThisWork$1 [Q]