Hi all,
I'm trying to rewrite some urls but for an unknow reason I can't get some rules to work.
I used the 'Url Rewrite' module inside IIS 7.5 (Win 2K8R2):
<outboundRules>
<rule name="replace .aspx by .html (for non-default aspx)" preCondition="ASPX/html" enabled="true">
<match pattern="^(.*/)(Pages/)(?!Default)([^\/]*)(\.aspx)$" />
<action type="Rewrite" value="{R:1}{R:3}.html" />
</rule>
<rule name="Replace pages/default.aspx" preCondition="ASPX/html" enabled="true">
<match pattern="([^\s\.]*?)/Pages/Default.aspx" />
<action type="Rewrite" value="{R:1}/" />
</rule>
<rule name="aspx to html" preCondition="ASPX/html" enabled="true">
<match filterByTags="None" pattern="^(.*)\.aspx$" />
<action type="Rewrite" value="{R:1}.html" />
</rule>
<preConditions>
<preCondition name="ASPX/html">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
1. I tried to convert every aspx pages to html Under FailedReqLogFiles, I've seen that this rules had EvaluationPerformed=0 and EvaluationSucceedee=0
2. I tried to replace the '\Pages\Default.aspx' to '\' and It worked (EvaluationPerformed=32 and EvaluationSucceedee=32)
3. I tried to replace the NOT '\Pages\Default.aspx' to '.html' and It didn't work (EvaluationPerformed=0 and EvaluationSucceedee=0)
I really don't understand why only one rule is working. I tried to evaluate my RegEx and my tests were correct...
Have you got any idea of the problem? Thanks