Gaconfig url builder bad impact on removing file extensions

Hi Barbara,

Uh, oh! I see the problem! IIS uses one of two M$-peculiar coding languages for its implementation of rewrite directives (only one is relatively similar to Apache’s mod_rewrite). Please note the keyword “relatively” because M$ did not duplicate Apache’s complete functionality with it’s mod_rewrite implementation … and I must guess that Apache’s {IS_SUBREQ} variable is one which is missing.

Years ago, when I realized that mod_rewrite code could be written to NOT loop on a circular redirect, I first created code to mark the redirection with an unique query string. I believe that you MIGHT be able to do that, too, using code like:

[code]RewriteEngine On
# the query string contains "redirect=true"
RewriteCond %{QUERY_STRING} redirect=true
# strip the .html file extension and redirect showing the new {REQUEST_URI}
RewriteRule ^(.+).html$ $1 [R=301,L]

# then, if the new {REQUEST_URI} (via {REQUEST_FILENAME} exists with an html extension
RewriteCond %{REQUEST_FILENAME}.html -f
# redirect the {REQUEST_URI} to {REQUEST_URI}.html (internally)
# I still don't like (.*) for other reasons but IIS may not like {REQUEST_URI}
# ... but use the end anchor, too!
# ( the $ after ^(.*) )
RewriteRule ^(.*)$ $1.html?redirect=true [L][/code]

Please let me know if that words for you as I will not use M$ online but should know when something does work for those in the M$ world. Thank you.

Regards,

DK