Web Development & Execution
David Addison
by David Addison
share this
« Back to the Blog

IIS Canonical Host Name Rewrite Bug


If you're getting spontaneous redirect loops on a Windows 2008 R2 to Windows 2012 R2 web server it might very well be the Redirect Loop Bug. The bug causes a dynamically created page, once in a while, to begin 301 redirecting to itself.  This issue will often times fix itself. We've noticed that the loop is sometimes associated with a busy website or server.  The bug is only exposed through the use of the URL Rewrite Canonical Host Name Rule as follows:

This is our typical configuration at Dirigo.

  • {HTTP_HOST}, Does Not Match the Pattern, ^www\.domain\.com$, Ignore Case
  • {REQUEST_METHOD}, Matches the Pattern, Get, Ignore Case
  • {HTTP_HOST}, Does Not Match the Pattern, .*\.local, Ignore Case
  • {HTTP_HOST}, Does Not Match the Pattern, .*\.dirigodev\.com, Ignore Case

Adding this new rule will force the server to not cache the the canonical rule(s) and will circumvent the bug.

  • {REMOTE_PORT}, Matches the Patttern, .* Ignore Case

Reference: https://forums.iis.net/t/1178961.aspx?Redirect+loop+bug


Thank you for contacting us!

We'll be in touch!

Back Home ×