Mobile app version of vmapp.org
Login or Join
Ogunnowo487

: In IIS what is the difference between rewrite rules managed by URL Rewrite Module versus those only in web.config? In IIS what is the difference between rewrite rules managed by URL Rewrite

@Ogunnowo487

Posted in: #Iis7 #UrlRewriting

In IIS what is the difference between rewrite rules managed by URL Rewrite Module versus those which are only in the web.config file and do not appear in the URL Rewrite Module?

Using the URL Rewrite Module in IIS 7.5 to add a rule...

I notice that the rules, when looking at the web.config, are quite readable, and they are rooted in .

In contrast, using rewrite rules via web.config not managed by the URL Rewrite module...

do not seem to be as readable (perhaps this is not true for all), and these rules are rooted in instead of .

QUESTION: What is the difference, and what are pros/cons of using each? Personally, I like the ability to use the IIS module because it gives you an interface to test rules.

Example of a rule from the IIS 7.5 Rewrite Module:

<rewrite>
<rules>
<rule name="LowerCaseRule1" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" />
</rule>
</rules>
</rewrite>


Example of a rule not managed by the IIS 7.5 Rewrite Module:

<rewriter>
<rewrite url="^/([0-9]+)/([0-9]+)/.*.aspx$"
to="~/ContentDisplay.aspx?CID=&amp;SID=" processing="stop" />
</rewriter>


note: I added a linebreak to the second example of code after ".aspx$"

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo487

1 Comments

Sorted by latest first Latest Oldest Best

 

@Radia820

From memory (I had to research this a few years ago) it has to do with what ISAPI extension is handling the redirect - what you want is something which is running in the same process space as IIS otherwise the redirection can actually slow or choke the webserver depending on the volume.

I believe that the method you describe above is performing the rewrite with asp.net rather than an ISAPI filter.

I appreciate this isn't the best answer, I hope it points you in the right direction.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme