This will work on IIRF v1.2.15 and later. It uses the special replacement pattern '-', which says to NOT rewrite at all.

RewriteLog C:\temp\Nick-iirf-
RewriteLogLevel 4

RewriteFilterPriority HIGH

# Redirect to the proper host if necessary
RewriteCond %{HTTP_HOST} ^(?!www\.mywebsite\.com)(.+)$ [I]
RewriteRule ^(.*)$   http://www.mywebsite.com/$1     [R=301,L]

# Don't rewrite any request that ends with one of these extensions.
# Because of the [L] flag, any PHP script (or GIF image, etc) will not be processed by any rules appearing later in this ini file. 
RewriteRule (.+\.)(php|jpg|png|jpeg|gif|ttf|sql|txt|htm|zip|css)$   -   [L]

# Don't rewrite anything that starts with /accomodation.
# Again, because of the [L] flag, URLs that match here will not be processed by any other rules  appearing later in this ini file. 
RewriteRule ^/accomodation/(.*)$   -   [L]

# Special case pet-friendly and wheelchair-access
RewriteRule wheelchair-access$ /accommodation/listing-all.php?Features=Wheelchair+Access+or+some+disabled+facilities  [L]
RewriteRule pet-friendly$      /accommodation/listing-all.php?Features=Pet+Friendly  [L]

# any .html request gets rewritten to listing-view.php for the given Title
RewriteRule ^/(.*)\.html$ /accommodation/listing-view.php?Title=$1

# anything else  gets rewritten to listing-all.php for the given type
RewriteRule ^/(.+)$ /accommodation/listing-all.php?type=$1

Last edited Oct 6, 2008 at 9:24 PM by Cheeso, version 1

Comments

No comments yet.