Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > IIS7 Url Rewrite module doesn't work in Kentico View modes: 
User avatar
Member
Member
weelee.yeo-tribalddb.com - 9/11/2012 11:49:41 PM
   
IIS7 Url Rewrite module doesn't work in Kentico
Hi,

We are trying to use IIS7 Rewrite module to rewrite specific url to another website.
This is the configuration that we use in the web.config:

<rewrite>
<rules>
<rule name="ReverseProxySiteChampion" stopProcessing="true">
<match url="^agency/(.+)$" />
<action type="Rewrite" url="http://tribalddb.resultsdemo.com/agency/{R:1}" />
</rule>
<rule name="ReverseProxySearch" enabled="true" stopProcessing="true">
<match url="^search/go$" ignoreCase="false" />
<action type="Rewrite" url="http://tribalddb.resultsdemo.com/search" logRewrittenUrl="true" />
</rule>
<rule name="ReverseProxyAssets" enabled="true" stopProcessing="true">
<match url="^search/(.*)" ignoreCase="false" />
<action type="Rewrite" url="http://tribalddb.resultsdemo.com/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>


But it keeps redirect me to the Page not found page.
Is there any way we can use the IIS7 Rewrite module in Kentico? Is it overwritten by Kentico?

User avatar
Member
Member
weelee.yeo-tribalddb.com - 9/12/2012 10:13:35 PM
   
RE:IIS7 Url Rewrite module doesn't work in Kentico
Hi guys,

We found out what caused this issue and it is


...
<modules runAllManagedModulesForAllRequests="true">
...


As you can see, we are using IIS7 and set the runAllManagedModulesForAllRequests value to true to allow for extension-less url. If we set the value to false, the IIS redirection works but we can't use the exentsion-less url.
Is there anyway we can implement both at the same time?

Thank you,
Regards,
Ronald Wisnu Hariyanto

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/13/2012 2:47:41 AM
   
RE:IIS7 Url Rewrite module doesn't work in Kentico
Hi,

could you please exclude the url on which you would like to apply rewriting rule in Kentico?

You can find the setting in the Site Manager - Setting - Content - URL and SEO - Excluded URLs.

This will exclude page from the Kentico rewriting engine and your custom rules should be applied.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
weelee.yeo-tribalddb.com - 9/13/2012 3:23:54 AM
   
RE:IIS7 Url Rewrite module doesn't work in Kentico
Thank you Ivana!

I have done that but now every time I go to the url that supposed to be rewrite by IIS, I am being redirected to the login page. I have put the authorisation as per below

   
...
<location path="agency">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="search">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
...


but I still got redirected to Login page.
Did I miss anything?

Thank you,
Best Regards,
Ronald Wisnu Hariyanto

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/13/2012 6:46:53 AM
   
RE:IIS7 Url Rewrite module doesn't work in Kentico
Hi,

and what is the url your are calling?

In general the location is relative to the web.config file.

Here is an example of code:


<configuration>
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>

<location path="Default.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

</configuration>



Also, is not it possible that rewriting is executed correctly and problem comes from the destination page which is redirected to the login page?

Best regards,
Ivana Tomanickova