IIS HTTP Redirect too many times errorRSS

2 replies

Last post Jan 04, 2019 08:59 AM by Jalpa Panchal

  • IIS HTTP Redirect too many times error

    Dec 04, 2018 10:23 AM|distanceeducation|LINK

    I am in process of moving my website i.e distanceeducation360.com to an IIS server but I am having a difficulty setting up an SSL redirection for my website in IIS.  I want to move it from non-www to www.

    I am getting ERR_TOO_MANY_REDIRECTS error. Since I'm not an expert I am not sure how to solve this issue.

    I have tried the below code but no luck

    <system.webserver>
    <rewrite>
    <rules>
    <rule name=”Redirect to WWW” stopprocessing=”true”>
    <match url=”.*”></match>
    <conditions>
    <add input=”{HTTP_HOST}” pattern=”^yourdomainname.com$”></add>
    </conditions>
    <action type=”Redirect” url=”http://www.yourdomainname.com/{R:0}” redirecttype=”Permanent”>
    </action></rule>

    <rule name=”Default Document” stopprocessing=”true”>
    <match url=”(.*?)/?default\.aspx$”>
    <action type=”Redirect” url=”{R:1}/”>
    </action></match></rule>
    </rules>
    </rewrite>
    </system.webserver>

    Can anyone here help me solve this issue? What could be the problem?

  • Re: IIS HTTP Redirect too many times error

    Dec 04, 2018 10:19 PM|lextm|LINK

    Lex Li
    IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: IIS HTTP Redirect too many times error

    Jan 04, 2019 08:59 AM|Jalpa Panchal|LINK

    Hi distanceeducation,

    distanceeducation

    <system.webserver>
    <rewrite>
    <rules>
    <rule name=”Redirect to WWW” stopprocessing=”true”>
    <match url=”.*”></match>
    <conditions>
    <add input=”{HTTP_HOST}” pattern=”^yourdomainname.com$”></add>
    </conditions>
    <action type=”Redirect” url=”http://www.yourdomainname.com/{R:0}” redirecttype=”Permanent”>
    </action></rule>

    <rule name=”Default Document” stopprocessing=”true”>
    <match url=”(.*?)/?default\.aspx$”>
    <action type=”Redirect” url=”{R:1}/”>
    </action></match></rule>
    </rules>
    </rewrite>
    </system.webserver>

     Your url rewrite rule is not in proper format and i tried your url rewrite code:

    rule name="Redirect to WWW" stopProcessing="true">
    <match url=".*"></match>
    <conditions>
    <add input="{HTTP_HOST}" pattern="^site1.com$"></add>
    </conditions>
    <action type="Redirect" url="http://www.site1.com/{R:0}" redirectType="Permanent"/>
    </rule>

    <rule name="Default Document" stopProcessing="true">

    <match url="(.*?)/?index\.php$" />
    <action type="Redirect" url="{R:1}/"/>
    </rule>

    it shows me below error:

    Could you tell us what is your actual requirement?

    Regards,

    Jalpa.

    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 MSDNFSF@microsoft.com.