« Previous Next »

Thread: Providing same behavior in IIS 7 as was available in IIS 6 for Http Redirect

Last post 09-25-2009 6:14 AM by Leo Tang - MSFT. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 09-18-2009, 11:21 AM

    Providing same behavior in IIS 7 as was available in IIS 6 for Http Redirect

    In IIS6, I frequently used a feature for redirection to a Url.  In IIS 6, I used to do the following to redirect to a virtual directory:

    1. Go to the Home Directory tab for the web site
    2. Select a redirection to a Url
    3. Redirect to /myvirtualdirectory
    4. Select a Directory below entered
    5. Select a permanent redirection for this resource

    In IIS 7, however, I have been thus far unable to discover the option to redirect to "A Directory Below Entered" in the same manner as was available in IIS 6.

     Can someone tell me how to accomplish this in IIS 7?  I have tried several things through the IIS 7 GUI for Http Redirect, but none of them have solved the capability I have been trying to implement. 

     Thanks.

  • 09-19-2009, 6:06 PM In reply to

    Re: Providing same behavior in IIS 7 as was available in IIS 6 for Http Redirect

    I setup a folder called Source and another called Destination on the same website (w2k8 R2), i setup this rule in the Source folder and this seems to do what you want.  I used the HTTPRedirect feature you mentioned.   

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <httpRedirect enabled="true" destination="/Destination" />
        </system.webServer>
    </configuration>

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


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 09-24-2009, 7:43 PM In reply to

    • sujitvp
    • Not Ranked
    • Joined on 09-24-2009, 11:27 PM
    • Posts 2

    Re: Providing same behavior in IIS 7 as was available in IIS 6 for Http Redirect

    I have problem that seems related to the original question and the answer. I have 4 websites on my IIS 7.0 installation. All of the websites have a similar site structure. One of the folders under the root is /Source and I need to redirect this to /Destination for just Site4.

    I tried using the web interface and the appcmd for the HTTPRedirect module to enable and set the redirection as desired on the /Source directory of Site4. This works!

    The problem I am facing is that alongwith the Site4, the /Source directories of all the other 3 sites also get enabled for redirect to /Destination (relative to within the same site as /Source). I cant disable it on any of the other 3 sites either, as it immediately disables the redirect setting in all 4 (including Site4) sites.

    Can someone help me setup the redirection only for the Site4 site, without automatically setting it up for the other sites too?

    Thanks.

  • 09-25-2009, 6:14 AM In reply to

    Re: Providing same behavior in IIS 7 as was available in IIS 6 for Http Redirect

    Hi,

    Do your 4 website’s "Source" directory have the same physical path ?

    With IIS7.0, the setting via http redirect feature stored in the web.config file in the section <configuration> <httpRedirect/> </configuration>. If your virtual directories have the same physical path, they will use the same web.config file. Then your changes on one virtual directory’s http redirect feature will be replicated to the other virtual directories.

    If this is your scenario, you can either use <location> element to store the <httpRedirectt> section in root web.config file or specify different physical path for the virtual directories.

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)
Microsoft Communities