1

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.

UserSN
  • 953
  • 1
  • 11
  • 33
  • https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules If you know how to debug, then the cause should be clear. – Lex Li Sep 21 '20 at 18:17
  • @LexLi i've not used FRT before i'll look into it. – UserSN Sep 21 '20 at 18:33
  • @LexLi with the debug turned on it gives me 10 seconds on `Name:UrlMappingsModule Type:System.Web.UrlMappingsModule ` which dosen't really help. Also it seems that when I go to the site on mobile it dosen't trigger anything in the logs it simply says redirect loop on the phone. – UserSN Sep 21 '20 at 21:23
  • You have to edit the question to explain what is "it gives me 10 seconds on Name:UrlMappingsModule Type:System.Web.UrlMappingsModule". Show screen shots if possible. – Lex Li Sep 21 '20 at 21:32
  • @UserSN could try to remove the wild card host header binding and then try again. – Jalpa Panchal Sep 22 '20 at 07:57
  • @JalpaPanchal I've done this even with my standard bindings for just HTTP it's still looping this is insane – UserSN Sep 22 '20 at 12:34
  • dis you tried to clear the cache of the browser? – Jalpa Panchal Sep 23 '20 at 08:45
  • Yes, i cleared the cache of multiple browsers; chrome, firefox, edge, safari across multiple devices connected to different networks and even tried incognito mode. – UserSN Sep 23 '20 at 12:23

0 Answers0