Since IIS URL Rewrite's outbound rules are giving you so much trouble, here is another option. Use ColdFusion to rewrite the links in onRequestEnd
. This will allow you to use physical paths in your IDE, use default documents, and still get the outbound URLs sent to the browser in the desired format. I've updated my Gist with the details.
Here is a very basic approach. Turn off the outbound rewrite rule in web.config and add something like this to your onRequestEnd
function in Application.cfc
. (My regex is horrible, so this reReplace()
pattern only partially works the way your IIS pattern did.
<cfcomponent>
<cffunction name="onRequestEnd">
<!--- Get the generated output --->
<cfset var output = getPageContext().getCFOutput().getBuffer().toString()>
<!--- Apply outbound link rules --->
<cfset output = reReplace(output, '/info\.cfm\?subjectid=([^=&]+)', '/info/\1', 'all')>
<!--- Clear the previous output and send the rewritten output in its place --->
<cfcontent reset="true">
<cfoutput>#output#</cfoutput>
</cffunction>
</cfcomponent>
This won't perform as well as the URL Rewrite module in IIS, but it will give you everything else you are trying to achieve (once you get your regex tuned up).