Website optimization - Minimizing Redirects

J Shaw asked on June 29, 2016 04:35


I have been running some SEO and website performance tests and one of the complaints is minimizing redirects when the site loads.

Does anyone have any suggestions on ways to minimize these redirects, or possibly combine 2 or 3 of the redirects in to one?



Recent Answers

Dawid Jachnik answered on June 29, 2016 08:34


for the first two you can combine it in the rewrite module. You can setup there any redirect code you want for example 301

This is my quick working example

    <rule name="CanonicalHostNameRule">
      <match url="(.*)"/>
        <add input="{HTTP_HOST}" pattern="^www\.yoursitedomain\.pl$" negate="true"/>
      <action type="Redirect" url="https://www.yoursitedomainpl/{R:1}"/>
    <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="(.*)"/>
        <add input="{HTTPS}" pattern="^OFF$"/>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther"/>
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.