views:

2025

answers:

4

We've inherited an application that uses the Intelligencia.UrlRewriter module. Our environment though is IIS7. We've already set our site to run in the classic asp.net application pool (which aparantly works for a lot of these kinds of problems). However we're still not seeing the URLs in our app be rewritten.

Has anyone run into this?

A: 

Yes I had the exact same problem with Intelligencia.UrlRewriter module, running under Win Vista & IIS7, however switching to the classic asp.net app pool did fix the problem. Are you running the app in a new virtual directory? That can sometimes mess with the root path to the application which could make a difference to the rules in the web.config

Nick Allen - Tungle139
+2  A: 

You need to define the config on the system.webServer element, like:

    <system.webServer>
         <validation validateIntegratedModeConfiguration="false" />
     <modules runAllManagedModulesForAllRequests="true">
  <add name="UrlRewriter" 
   type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
     </modules>
    </system.webServer>

You can keep both config. What you probably have now is:

<httpModules>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
     </httpModules>

Check the section "Migrating ASP.NET Applications to IIS 7.0 Integrated mod" on http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis7/

ps. I have been using it with no trouble at all, as long as that config is in.

Update 1: Also check http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx, particularly "Approach 3: Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7", since the config I added has the extension-less config.

eglasius
Freddy, I gave that a shot but it didn't work. I think IIS7 doesn't like the url(ex: gallery/view/1 ) being extensionless. Can regex fix this?Here's current:<if url="~/showItem/item/(\d+)(/)?(\?.+)?$"><rewrite to="~/itemViewers/Items.aspx?itemId=$1" processing="stop" /></if>
hmm, I haven't used that style of config, mine looks like this: <rewrite url="~/something/(.+)" to="~/whatever.aspx?code=$1" />
eglasius
I don't have extra query parameters, and other stuff though. Anyway I would try it with a simple version first, to rule out anything with that config.
eglasius
A: 

I think IIS7 doesn't like the url(ex: gallery/view/1 ) being extensionless. Can regex fix this?

Here's current:

It didn't show the code, update it, select the text and select the code button so we get to see it :)
eglasius
A: 

I have spotted the same problem, after few tries I found out that changing asp mode to integrated pipeline helped.

kliszaq