HTTP Redirect [Answered]RSS

1 reply

Last post Jun 09, 2016 02:26 AM by Jean Sun

  • HTTP Redirect

    Jun 08, 2016 05:00 PM|lsavalla|LINK

    Can anyone show me how do I set the (Redirect Behavior) to "Only redirect requests to content in this directory (not subdirectories) with powershell; here is the command that I am using 

    Set-WebConfiguration system.webServer/httpRedirect "IIS:\sites\$siteName" -Value @{enabled="true";destination="$redirectPage";exactDestination="true";httpResponseStatus="Found"}


  • Re: HTTP Redirect

    Jun 09, 2016 02:26 AM|Jean Sun|LINK


    You need to disable httpRedirect at the subdirectories level.

    Please take following code as reference:

    Set-WebConfiguration system.webServer/httpRedirect "IIS:\sites\$Site\$Subdirectory" -Value @{enabled="false"}

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact