Previous Next

Thread: behavior change in the http redirect module between IIS 7.0 and IIS 6.0.

Last post 08-29-2008 10:23 PM by ksingla. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 08-25-2008, 9:01 PM

    • sammy_1
    • Top 500 Contributor
    • Joined on 01-09-2008, 5:28 PM
    • Posts 10

    behavior change in the http redirect module between IIS 7.0 and IIS 6.0.

    There seems to different behavior in the http redirect module between IIS 7.0 and IIS 6.0.

    In IIS 6.0 if you create a virtual directory and then redirect the virtual directory to some other locations the redirect is tied to the virtual directory alias/name, you can create a second and third virtual directory with the same physical location and redirect to different locations. In IIS 6.0 multiple aliases can redirect to multiple locations with one physical location of the VD.

    In IIS 7.0 the redirect is different, it is tied to the physical location, so user can create multiple virtual directories but when trying to redirect you can only redirect to one location, because the http redirect seems to be tied to the physical location of the of the VD .

    I tested this and confirmed that the above is the behavior.

    If you can confirm this behavior please communicate back, the question here

    is the new behavior is a BUG or a new feature behavior?.

     

     

  • 08-29-2008, 1:30 PM In reply to

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

    Re: behavior change in the http redirect module between IIS 7.0 and IIS 6.0.

    Hi Sammy_1,

    I think you have your redirect rules in web.config which is in root of your virtual directory. You can put different redirect rules in applicationHost.config under location tags for different virtual directories which will make sure different vdirs get different redirect behavior. Redirect rules in web.config of vdir root will get picked for all vdirs pointing to this location. In IIS6, we didn't have distributed config. So this problem didn't exist. Let me know if you have trouble moving the rules to applicationHost.config.

    Thanks.
    Kanwal

  • 08-29-2008, 2:42 PM In reply to

    • sammy_1
    • Top 500 Contributor
    • Joined on 01-09-2008, 5:28 PM
    • Posts 10

    Re: behavior change in the http redirect module between IIS 7.0 and IIS 6.0.

     Hi Knawal
    Thank you for the response, what you have said make sense.
    The issue I facing with is that I need to automate the process of the redirect through .bat file using the appcmd on many systems.
    appcmd.exe set config "Default Web Site/sales" -section:system.webServer/httpRedirect /enabled:True /destination:"/production"
     
    Is there a way to changes the default redirect rule behavior using  appcmd.exe ?
     
    I'm trying to avoid parsing through the file (web.conf) and  then coping it to
    applicationHost.config using stream reader and writer.
     
    Thanks for answering the initial question.

     



  • 08-29-2008, 10:23 PM In reply to

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

    Re: behavior change in the http redirect module between IIS 7.0 and IIS 6.0.

    If you append -commit:apphost to the appcmd command you are using, it will write the configuration to applicationHost.config which will make this configuration effective only for a particular site/app/vdir.

Page 1 of 1 (4 items)
Page view counter