Previous Next

Thread: IIS 7.0 HTTP redirect is working fine in a case of URL but not to a file or a directory

Last post 08-07-2008 2:17 AM by ksingla. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 08-06-2008, 4:48 PM

    • sammy_1
    • Not Ranked
    • Joined on 01-09-2008, 5:28 PM
    • Posts 7
    • sammy_1

    IIS 7.0 HTTP redirect is working fine in a case of URL but not to a file or a directory

    I have a situation I need to redirect a vdir to another file or directory

    Once I redirect the vdir to http url that seems to be working fine, but the redirection to file or directory is not working.

    Is there a components or something that is missing ?

     
    Working scenario
    appcmd.exe set config "Default Web Site/test3" -sect

    ion:system.webServer/httpRedirect /enabled:true /destination:"http://www.yahoo.c

    om"

     

     

     Not working
     appcmd.exe set config "Default Web Site/test3" -sect

    ion:system.webServer/httpRedirect /enabled:true /destination:"c:\sales\prod.txt

    "

     

     

     

     

  • 08-06-2008, 11:18 PM In reply to

    Re: IIS 7.0 HTTP redirect is working fine in a case of URL but not to a file or a directory

    You shouldn't have an absolute path.  C:\sales\prod.txt is like a file server path.  Try /sales/prod.txt and see if it displays.

    Steve Schofield
    Windows Server MVP - IIS
    MCTS - Windows Hosting

    http://weblogs.asp.net/steveschofield
    http://www.iislogs.com
    http://www.orcsweb.com/
    Managed Hosting Solutions
    #1 in Service and Support
  • 08-07-2008, 2:17 AM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 411
    • ksingla

    Re: IIS 7.0 HTTP redirect is working fine in a case of URL but not to a file or a directory

    Yes. httpRedirect module returns a 302 to client with location header pointing to URL it should request. You need a valid URL path which can be requested by client as destination for redirect to work.

    Thanks,
    Kj

Page 1 of 1 (3 items)
Page view counter