0

I followed this solution on how to redirect http to https. It works on pc but not on phones for some reason (and im sure neither on iPad or tablets). You can test the website here. I think IIS is ignoring http requests on phones but I dont know why it would. If I wait long enough when testing on my phone, I get err_connection_timed_out. Connecting to https on phone works just fine.

I installed Failed Request Tracing using this guide. When testing on my phone (http) it does not log anything. When testing https, it does (code 200). In the guide they ask me to log 200-399 codes, but to be sure I changed that to 200-999 but it makes no difference.

Is there a way to log the timeout request or figure out why it does not load?

This is my web.config file:

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.web>
        <customErrors mode="Off" />
        <compilation debug="true" />
    </system.web>
    <system.webServer>
    <rewrite>
           <rules>
              <rule name="Redirect to HTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
                 <match url="*" ignoreCase="true" negate="false" />
                 <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                    <add input="{HTTPS}" ignoreCase="true" matchType="Pattern" negate="false" pattern="OFF" />
                 </conditions>
                 <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" redirectType="Permanent" />
              </rule>

        <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{R:1}" pattern="\.(gif|jpe?g|png)$" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/index.php/{R:1}" />
                </rule>
           </rules>
        </rewrite>
    <security>
            <requestFiltering allowDoubleEscaping="true">
                <requestLimits maxUrl="3000000" maxQueryString="3000000" />
            </requestFiltering>
     </security>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
            </files>
        </defaultDocument>
        <urlCompression doDynamicCompression="true" />
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="WWW Server" areas="Rewrite" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions timeTaken="00:00:00" statusCodes="200-999" />
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
</configuration>

At the advanced settings in IIS I put HSTS -> http to https redirect to true and HSTS -> enabled to true. In the SSL-Settings I unchecked the require SSL button. I am using IIS version 10.0.

This guy seems to have the same issue, just not specific to http. Maybe the info in that question helps answering this one.

1
  • 1
    When FRT "does not log anything", the most likely cause is that those HTTP requests never land on this IIS machine. You need to use tools like Wireshark to capture/analyze network packets to learn more.
    – Lex Li
    Oct 18, 2022 at 5:50

1 Answer 1

0

I figured the issue was that port 80 was turned off and only port 443 was accepted. This made the server ignore any http request and not redirect them. That it worked on PC seems to have been an illusion. It was cache that made it work I belive.

So, turning on port 80 fixes my issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .