I found out how to exclude a URL containing a specific string from URL rewriting. You have to include the specific string in the last rule in UrlRewriter.config file. This rule is as below. One needs to go to the if part of this rule and include the specific string in the list. For example, if you want to exclude a URL that contains
Telerik then just add
|Telerik to the end of the if list i.e. just after
|ckfinder in the if list.
In my case, I added the specific string
|Telerik\.Web\.UI\.DialogHandler just after
|ckfinder.
What this rule is saying that if the URL does NOT contain any of the strings that are separated by | (pipe) character, then do URL rewriting processing according to what's within the if rule, else go to next rule; but, since this is the last rule and there is no next rule, so effectively no URL rewrite occurs.
<if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|install|error|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx|ftb.imagegallery\.aspx|ckfinder|Telerik\.Web\.UI\.DialogHandler).)*$">
<rewrite url="^~/(.+)?\?(.+)?$" to="~/Default.aspx?g=$1&$2" processing="stop" />
<rewrite url="^~/(.+)?\.aspx$" to="~/Default.aspx?g=$1" processing="stop" />
<rewrite url="^~/(.+)?$" to="~/Default.aspx?g=$1" processing="stop" />
</if>