I'm experiencing some weird redirect loops on mobile devices and sometimes desktops. I think it has to do with my URL Rewrite rule and the wildcard SSL certificate/Bindings.
In IIS my bindings are:
HN:mydomain.com - IP:MYIP
HN:www.mydomain.com - IP:MYIP
HN:https:\\mydomain.com - IP:MYIP - Linked to wildcard SSL - Require Server name Indication (ON)
HN:https:\\www.mydomain.com - IP:MYIP - Linked to wildcard SSL - Require Server name Indication (ON)
HN:https:\\*.mydomain.com - IP:MYIP - Linked to wildcard SSL - Require Server name Indication (ON)
The SSL I purchased is a wildcard SSL for *.mydomain.com
The URL rewrite rule is:
<rewrite>
<rules>
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
UPDATE:
I'm now experiencing the same problem on multiple website across different webservers. I've done the following:
1)Duplicated my .net application/clean install.
2)Setup regular http bindings & the website loads fine
3)installed the SSL cert & setup https bindings & url rewrite rules, the redirect works fine on desktop fails on mobile
4)removed the rewrite rules & removed the SSL bindings, now the website is stuck in a loop even on desktop
5)restarted the server & then restarted iis with iisreset
in CMD the loop persists|
6)uninstalled the SSL cert from MMC, the loop persists
7)checked the web.config & default.aspx document to ensure theres no redirect or rewrite snippets in code, there are none.
In the FailedReqLogFiles the only request I see that takes longer than 5 ms is the following:
-VIRTUAL_MODULE_UNRESOLVED
Name
UrlMappingsModule
Type
System.Web.UrlMappingsModule
Checking on redirectdetective.com it shows a endless 302-Temporary Redirect.
I've made sure this is not a local problem, I have the same problem across 4 different networks, checked on desktop (chrome,firefox,edge) cleaning cache every time & android/iphone devices chrome&firefox.