Previous Next

Thread: Wildcard application mapping control from Web.config?

Last post 05-01-2008 8:00 PM by CodingTheWheel. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 03-29-2008, 1:27 PM

    • blove57
    • Not Ranked
    • Joined on 11-16-2007, 11:48 PM
    • Posts 1

    Wildcard application mapping control from Web.config?

    Is there a way to turn on wildcard mapping in IIS7 from a Web.config file? I have a .NET 3.5 website with a few C# HTTP Modules such as URL redirect scripts that required "Wildcard application maps" turned on for the .NET framework (pointed to the same dll as what .aspx uses). Right now the website is running on IIS6 and did this thru the IIS6 management console. But now I've moved the website to a IIS7 shared hosting and now wanted to turn Wildcard application mapping via the Web.config file. Is this possible? I don't have IIS7 console control since it's shared.

  • 03-29-2008, 11:36 PM In reply to

    Re: Wildcard application mapping control from Web.config?

    Yes, under IIS7 you no longer have to do this through the IIS console. All extensions can be passed into ASP.NET. Start by adding the following attribute to your modules tag in your web.config. This will cause your modules to be called even for non-.aspx extensions:

    <modules runAllManagedModulesForAllRequests="true">

    Hope this helps.

    CodingtheWheel.com - Building the collective hamster wheel, one line of code at a time.
  • 05-01-2008, 12:12 PM In reply to

    Re: Wildcard application mapping control from Web.config?

    We are trying to implement rewriting for non existent directories and files.

     

    although we can make domain.com/filename.aspx to redirect, the same is not happening for domain.com/directoryname

     Since we are using IIS 7, we tried to add

    <modules runAllManagedModulesForAllRequests="true">

    in the system.webserver section of the config file.

    The documentation states that this should work, but strangely it does not.

    Can anyone guess what the reason could be?

     

    all help will be appreciated.

     

  • 05-01-2008, 12:21 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 1,083

    Re: Wildcard application mapping control from Web.config?

    Are you doing the rewriting using a managed module?  What API are you using?  Are you running in integrated mode?  Collect "failed request tracing" for the request where rewriting is not working.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-01-2008, 8:00 PM In reply to

    Re: Wildcard application mapping control from Web.config?

    Hi. A couple sanity checks:

    - Make sure you have IIS Integrated Pipeline mode turned on in IIS. If it's running in Classic mode your URL rewriter won't be called for the non-ASPX file extensions.

    - Make sure you're using <system.webServer>. Okay, looks like you've done that, but also make sure you don't have any entries using the old <httpModules> tag, or if you do, temporarily turn those off just for clarity. (These can coexist but for clarity I find it's best to comment out the old stuff entirely and move everything to system.webServer.)

     - It should look something like this:

     <system.webServer>
     <modules runAllManagedModulesForAllRequests="true">
     <add name="MyUrlRewriter" type="XBlog.Core.MyUrlRewriter, XBlog.Core"/>
    etc

    Hope that helps. 

    CodingtheWheel.com - Building the collective hamster wheel, one line of code at a time.
Page 1 of 1 (5 items)
Page view counter