Redirect only root of siteRSS

3 replies

Last post Oct 29, 2019 01:57 AM by Jalpa Panchal

  • Redirect only root of site

    Oct 28, 2019 04:12 PM|christopher877|LINK

    I am trying to create a redirect for an IIS 8.5 site where it ONLY redirects the domain and nothing below it. For example, I am looking to redirect '' to '' and nothing else. Using the HTTP redirect module, I was able to get it to partially work. I configured it to only redirect requests to content in the root directory but I only want the domain name to redirect not the pages within. For example, was still redirecting when I didn't want it to. See examples below.

    examples: - redirect - do not redirect - do not redirect

  • Re: Redirect only root of site

    Oct 28, 2019 05:17 PM|lextm|LINK

    Lex Li
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Redirect only root of site

    Oct 28, 2019 07:18 PM|christopher877|LINK


    Please use URL Rewrite module to achieve this,

    I can't seem to get it to work using the rewrite module. 

  • Re: Redirect only root of site

    Oct 29, 2019 01:57 AM|Jalpa Panchal|LINK


    You could use below URL rewrite rule:

     <rule name="domian redirect" stopProcessing="true">
                        <match url="^$" />
                            <add input="{HTTPS}" pattern="on" />
                            <add input="{HTTP_HOST}" pattern="^$" />
                        <action type="Redirect" url="" />

    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