i have site developed with asp.net webform by VS2013 IDE. i am new in iis rewrite rule and first time using for a web site. i have used couple of inbound and one outbound rule in web.config.
when i am running site from VS2013 with iis express then outbound rule is throwing error. if i comment outbound rule then all inbound rule working fine.
but when i publish my site to IIS7/IIS8 with all inbound and outbound rule then site running fine. so my issue is outbound rule is not working with iis express but it sppose to work because inbound rule is working with iis express.
so here is my outbound which is not running with iis express but same works fine with iis7/8.
<outboundRules>
<rule name="add outbound rule" preCondition="Ishtml" enabled="true" stopProcessing="true">
<match filterByTags="A" pattern="(\/[a-z]+\/)(.*)" negate="true" />
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<preConditions>
<preCondition name="Ishtml">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="text/html" />
</preCondition>
</preConditions>
</outboundRules>
here is my full inbound & outbound rules
<system.webServer>
<rewrite>
<rules>
<rule name="Always redirect root extensionless path to index.aspx" stopProcessing="true">
<match url="^$" />
<action type="Redirect" url="/Default.aspx" appendQueryString="true" logRewrittenUrl="true" />
</rule>
<rule name="Rewrite rule for Redirecting countries" stopProcessing="true">
<match url=".*.aspx" />
<conditions trackAllCaptures="true">
<add input="{REQUEST_URI}" pattern="[a-z]{2}/(.*)" />
</conditions>
<action type="Rewrite" url="/{tolower:{C:1}}" appendQueryString="false" logRewrittenUrl="true" />
</rule>
</rules>
<outboundRules>
<rule name="add outbound rule" preCondition="Ishtml" enabled="true" stopProcessing="true">
<match filterByTags="A" pattern="(\/[a-z]+\/)(.*)" negate="true" />
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<preConditions>
<preCondition name="Ishtml">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="text/html" />
</preCondition>
</preConditions>
</outboundRules>
i checked the tracing log and find this: the error as follows
ModuleName="RewriteModule", Notification="SEND_RESPONSE", HttpStatus="500", HttpReason="URL Rewrite Module Error.", HttpSubStatus="52", ErrorCode="Operation aborted
(0x80004004)", ConfigExceptionInfo=""
how to fix the above error as a result outbound rule should work with iis express.
please tell me where i made the mistake? drive me to right direction. thanks
User contributions licensed under CC BY-SA 3.0