0

I'm getting a connection reset error in browsers when I redirect a URL from http to https. I'm trying to locate the issue and have looked in C:\Windows\System32\LogFiles\HTTPERR and see only Timer_ConnectionIdle errors in the log. From what I was able to find, those are not related.

There are no logs in the FailedReqLogFiles folder and I'm not seeing anything but access logs in the W3SVC1 folder.

I'm completely lost on where to go from here. Here is my redirect rule.

Match URL
Requested URL: Matches the Pattern
Using: Regular Expressions
Pattern: .* and Ignore case

Conditions
Logical grouping: Match All
Input: {HTTPS}
Type: Matches the Pattern
Pattern: off

Server Variables
Blank

Action
Action type: Redirect
Redirect URL: https://{SERVER_NAME}/{R:0}
Append query string: checked
Redirect type: Permanent (301)

0

This snippet from web.config works for me.

<rule name="Redirect HTTP to HTTPS" stopProcessing="true">
  <match url="(.*)" />
  <conditions>
    <add input="{HTTPS}" pattern="OFF" />
  </conditions>
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>

The main difference between this and your configuration seems to be HTTP_HOST vs SERVER_NAME. I am using replacement pattern R:1 whereas you're using R:0, but this can be explained by the way I've defined my match pattern as (.*) rather than .*.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.