Reputation: 37633
I try to use IIS rewrite outbound rules at the IIS where some of website have it implemented successfully.
So I created a simple rule to replace the word "test" with "123456".
And I am getting this error
500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
Web.config
<system.webServer>
<!--<urlCompression dynamicCompressionBeforeCache="false" /> -->
<urlCompression doStaticCompression="false" doDynamicCompression="true" dynamicCompressionBeforeCache="false" />
It seems like if I add any (just ANY) oubound rule the website craches. I mean that the pattern of the rule doesnt have impact but the rule itself liek an entry.
Any clue?
P.S. Should I install URL Rewrite Module 2.0 coz it seems like I have installed the old version... Will it solve the issue?
P.S. I did some extra changes but it doesn't work at all.
< urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" / >
I have asked about this issue here as well https://forums.iis.net/t/1226401.aspx?Outbound+rule+is+giving+500+error+for+the+entire+website
Upvotes: 12
Views: 13503
Reputation: 1250
For outboundRules use like below details..
On the machine running the web site, from the command line run:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v LogRewrittenUrlEnabled /t REG_DWORD /d 0
You may need to follow this up with an iisreset
<urlCompression doStaticCompression="false" doDynamicCompression="true" dynamicCompressionBeforeCache="false" />
<rewrite>
<rules>
<rule name="InboundFriendlyAboutUs" stopProcessing="true">
<match url="^about-our-car-finance$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="page.aspx" />
</rule>
</rules>
<outboundRules>
<rule name="Outbound1" preCondition="IsHtml">
<match filterByTags="A, Form" pattern="^(.*)About-Us\.aspx$"/>
<action type="Rewrite" value="{R:1}about-our-car-finance"/>
</rule>
<preConditions>
<preCondition name="IsHtml">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html"/>
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
Upvotes: 3