Site structure
Version 6.x > Site structure > Use IIS7 URL Rewrite Module outbound rules with Kentico 6 View modes: 
User avatar
mmacarie - 11/18/2013 7:46:07 AM
Use IIS7 URL Rewrite Module outbound rules with Kentico 6

I'm having the following problem:
I want to expose CMSAdminControls folder as CMSUIControl.
I am trying to use IIS7 URL Rewrite Module and I have defined the following inbound and outbound rules:
<rule name="Inbound CMSUIControls" stopProcessing="true">
<match url="CMSUIControls/(.*)" />
<action type="Rewrite" url="CMSAdminControls/{R:1}" logRewrittenUrl="true" />
<rule name="Inbound CMSUIControls QueryString" stopProcessing="true">
<match url="(.*)" />
<add input="{REQUEST_URI}" pattern="(.*)CMSUIControls(.*)" />
<action type="Rewrite" url="{C:1}CMSAdminControls{C:2}" appendQueryString="false" />
<rule name="Outbound CMSUIControls" preCondition="IsHTML" enabled="true">
<match filterByTags="Img, Link, Script" pattern="(.*)CMSAdminControls(.*)" />
<conditions trackAllCaptures="true">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
<action type="Rewrite" value="{R:1}CMSUIControls{R:2}" />
<preCondition name="IsHTML">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />

The inbound rules are working ok but when I enable the outbound rule the URL Rewrite Module crashes on each request with 500 URL Rewrite Module error. I have enabled tracing and it returns the following error description "Outbound rewrite rules cannot be applied when the content of the HTTP response is encoded ("deflate"). "
However the compression is disabled at server level.

Am I missing something? Is there another better way to do this?

User avatar
mmacarie - 11/19/2013 6:28:10 AM
RE:Use IIS7 URL Rewrite Module outbound rules with Kentico 6
I've got it to work by using the solution provided here:

As an aditional step the resource compression must be disabled in Kentico for this to work.