« Previous Next »

Thread: urlrewriting httpmodule on IIS7 not being called -newbie-ish

Last post 03-29-2007 4:49 AM by pault. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 03-28-2007, 3:21 AM

    • pault
    • Not Ranked
    • Joined on 06-20-2002, 2:09 AM
    • Posts 2

    urlrewriting httpmodule on IIS7 not being called -newbie-ish

    Hi all,

     I posted this on the ASP.NET forums but with no response as yet. I am using maximumasp's IIS 7 Beta 2 trial to try and test some app features.

    I have written a very simple httpmodule to fire on the BeginRequest event and redirect based on the incoming request url.

    It works fine on my dev machine (XP Pro)  but when I deploy it, the module doesn't get called. I know in IIS6 you can map all incoming requests to be handled by asp.net but I was under the impression that in IIS7 you can just add the following to the web config to get the httpmodule to be called.

         <modules runAllManagedModulesForAllRequests="true">
          
    <add name="UrlRewriter" type="
    UrlRewriter" />
        </
    modules>

     

    All I get is a 404 which is what I would have expected with IIS6 but not IIS7.

    /* EDIT

     I think it may be something to do with the fact that is running as a hosted web core applicationa and may need some special configuration but I don't know what it is!

     here's the error:

    Server Error in Application "xxxxxxx"


    HTTP Error 404.0 - Not Found

    Description: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    Error Code: 0x80070002

    Notification: MapRequestHandler

    Module: IIS Web Core

    Requested URL: http://xxxxxxx.maximumaspbeta.com:80/test123

    Physical Path: m:\web\users\xxxxxxx\wwwroot\test123

    Logon User: Anonymous

    Logon Method: Anonymous

    Failed Request Tracing Log Directory: m:\web\users\xxxxxx\logs\failedreqlogfiles

    Handler: StaticFile

    Anyone have any ideas?

    Thanks,

    pault

  • 03-28-2007, 11:04 AM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 862

    Re: urlrewriting httpmodule on IIS7 not being called -newbie-ish

    Probably your module got called but URL rewriting didn't happen. What API are you using to for rewriting? Also can you enable tracing and verify that your module is called? http://www.iis.net/default.aspx?tabid=2&subtabid=25&i=969&p=3 explains how to enable tracing for your site.

    Follow me on twitter at http://twitter.com/kjsingla
  • 03-28-2007, 10:20 PM In reply to

    Re: urlrewriting httpmodule on IIS7 not being called -newbie-ish

    I can't speak to if the server is blocking it.  I would verify each step is being called in the integrated pipeline.  Here is a good article written by Scott Gutrhie.

    http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 03-29-2007, 4:49 AM In reply to

    • pault
    • Not Ranked
    • Joined on 06-20-2002, 2:09 AM
    • Posts 2

    Re: urlrewriting httpmodule on IIS7 not being called -newbie-ish

    Thanks for the suggestions, I tried to enable tracing but have limited access as it's a hosted account.

     I had also read the article by Scott Guthrie, that was where I got the idea from.

     BUT it was a stupid mistake on my part..I was checking the 3rd element of an array instead of the 2nd - happens to the best of us no? - not that I would know of course!

     Extensionless url rewriting now works fine.

     Thanks again for your time guys.

    pault

Page 1 of 1 (4 items)
Microsoft Communities