« Previous Next »

Thread: Redirects in IIS7 propagating out to all other redirect sites?

Last post 11-11-2009 3:03 PM by SQLRocks. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 06-25-2009, 10:24 AM

    Redirects in IIS7 propagating out to all other redirect sites?

     All--

    I've got a 2008/IIS7 server that houses a few sites and about 50 redirects.  This was originally hosted on 2k3/IIS6 with no issues.  Now I am having trouble setting the redirects for each hostname--I edit one, it propagates to all of them.  Any Thoughts?  I trust I am missing something simple.

     

    Thanks

     

    R.L.

  • 06-27-2009, 11:00 PM In reply to

    Re: Redirects in IIS7 propagating out to all other redirect sites?

    From your description, you are trying to use IIS 7 manager to manage the redirects.  Beyond having one domain. you'll bump into a issue. I ran into this before.  Here are a few options;.

    1) have all redirect domains have the same ip address then use a single site to handle the redirects. 

    2) Use URL Rewrite module to handle individual redirects. 

    http://blogs.iis.net/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx

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


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 06-27-2009, 11:19 PM In reply to

    • SQLRocks
    • Not Ranked
    • Joined on 01-15-2008, 11:56 PM
    • Posts 11

    Re: Redirects in IIS7 propagating out to all other redirect sites?

    I ran into this same issue.

     What is mostly likely occuring here is that each of your 50 redirect sites has the same directory configured. In IIS7 when you setup a redirect it is stored in web.config in the site directory. Since all 50 sites share the same directory when you change one, you change them all.

     My Quick solution was to create a separate directory for each of the redirection sites so that each has it's own web.config to store the redirection settings.

    My longer term solution was to build a single a Database driven redirection site. It catches all of the traffic not already assigned to a site, looks up the URL in a DB, then redirect appropriately. It was some simple code.

     -Phil

  • 06-28-2009, 12:50 AM In reply to

    Re: Redirects in IIS7 propagating out to all other redirect sites?

    Funny, I ran into the same issue with the same folder thing.  For a quick and dirty solution, I did separate IIS sites with separate folders.  Well, it was separate IIS sites pointed to the same root folder and a separate sub-folder.

    I later found the url rewrite module would do it but I didn't implement.

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


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 11-11-2009, 3:03 PM In reply to

    • SQLRocks
    • Not Ranked
    • Joined on 01-15-2008, 11:56 PM
    • Posts 11

    Re: Redirects in IIS7 propagating out to all other redirect sites?

    I responded earlier to this with the suggestion of using a unique directory for each site, which does work.

    I'm now using a different technique which is to store the actual redirection configuration at a higher level (applicationhost.config) instead of the site's web.config file. This allows multiple redirection sites all with the same home directory and yet each can have it's own unique URL that it redirect to.

    Here's an example of the the AppCmd I used to have a site (call it "xxxx") redirect to http://yyyy.com without making/changing the web.config file in the site's home directory.

    %windir%\system32\inetsrv\appcmd.exe set config "xxxx" -section:system.webServer/http
    Redirect -enabled:true -destination:http://yyyy.com -httpResponseStatus:Permanent -commitpath:apphost

Page 1 of 1 (5 items)
Microsoft Communities