I'm hosting a website (as a proxy with ARR) on an IIS server, and I want to redirect all HTTP traffic to HTTPS. However, when I enable the redirect rule in my web.config file, the browser returns ERR_TOO_MANY_REDIRECTS
.
I've tried troubleshooting this issue, but I can't seem to resolve it. Here are the details:
This is the rule I am using in my web.config file for the redirect:
<rule name="http to https" enabled="true" stopProcessing="true"><match url="(.*)" /><conditions><add input="{HTTP_HOST}" pattern="^(www.)?example\.com$" /><add input="{HTTPS}" pattern="^OFF$" /></conditions><action type="Redirect" url="https://example.com/{R:1}" redirectType="Found" /></rule>
What I've Tried:
- Checked the SSL Certificate: It's valid and working properly.
- Disabled the redirect rule: Disabling the rule allows the site to load without redirection, but only for HTTP.
- Verified DNS:A record is pointing to the correct IP address.ping and nslookup return the expected IP address.
- Cleared browser cache and cookies.
What could be causing the ERR_TOO_MANY_REDIRECTS error with the HTTPS redirect in IIS? How can I fix the configuration to ensure proper redirection without causing a redirect loop?
Any help or suggestions would be greatly appreciated!