« Previous Next »

Thread: Http Redirect from single file

Last post 07-14-2009 8:40 AM by TGFRules. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 07-13-2009, 9:45 AM

    • TGFRules
    • Not Ranked
    • Joined on 07-13-2009, 9:42 AM
    • Posts 3

    Http Redirect from single file

    When using the UI I am able to select a single file in the root of the default web site and make a Http Redirect to some folder/site.

    I am trying to do this with appcmd but without luck. One try was this

    C:\Windows\System32\inetsrv>appcmd set config "Default Web Site/default.htm" /section:httpRedirect /enabled:true /destination:http://www.contoso.com

    Thanks in advance :)

     

  • 07-13-2009, 10:43 AM In reply to

    Re: Http Redirect from single file

  • 07-13-2009, 10:48 AM In reply to

    • TGFRules
    • Not Ranked
    • Joined on 07-13-2009, 9:42 AM
    • Posts 3

    Re: Http Redirect from single file

    Thanks for the reply.

    The blog takes about redirecting an application but since the default.htm is not an application I not sure if I can use that approach.

  • 07-13-2009, 11:15 AM In reply to

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

    Re: Http Redirect from single file

    Since the configpath you are configuring is a file, we cannot create a web.config file under it.  So, you need to add an appropriate commitpath to the appcmd command (-commitpath:apphost to commit to applicationhost.config or -commitpath:"Default Web Site" to commit to web.config for default-web-site).

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 07-14-2009, 8:40 AM In reply to

    • TGFRules
    • Not Ranked
    • Joined on 07-13-2009, 9:42 AM
    • Posts 3

    Re: Http Redirect from single file

    Thanks alot - that solved it!

    I think it's a new thing that a web.config is needed for such an operation be that good or bad.

Page 1 of 1 (5 items)