subfolder is not resolved without force typing https

I have set up the subdomain on a dedicated windows server 2019 (not the same server as The main url works when I don’t type https (I simply enter in address bar and it is being redirected to https due to web.config settings). But when I call a subfolder without https e.g the server is not responding. If I force https manually and type with https it works!


  • the is the default website on IIS.

  • website bindings is set on port 80 for http and port 443 for https and assigned the propper SSL to https.

  • I have tried checking and unchecking "Require server name indication" when assigning the ssl but no change.

  • There is A record for on DNS server pointing to the server IP.

  • Browsers redirect from http to https but the curl command for main doman (even without subfolders) curl --head says: curl: (7) Failed to connect to port 80: Connection refused

  • these are the codes used in web.config to redirect requests to https: and remove default document from urls:

    <rule name="RemoveWWW" patternSyntax="Wildcard" stopProcessing="true">     <match url="*" />     <conditions logicalGrouping="MatchAll">         <add input="{HTTP_HOST}" pattern="" />     </conditions>      <action type="Redirect" url="{R:0}" redirectType="Permanent" /> </rule>    <rule name="RemoveDefaultDocument" stopProcessing="true">      <match url="(.*?)/?index\.asp$  " />      <conditions>          <add input="{HTTP_HOST}" pattern="localhost" negate="true" />      </conditions>      <action type="Redirect" url="{R:1}/" redirectType="Permanent" />  </rule>   <rule name="HTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true">      <match url="*" negate="false" />      <conditions logicalGrouping="MatchAll">          <add input="{HTTPS}" pattern="off" />          <add input="{HTTP_HOST}" pattern="localhost" negate="true" />      </conditions>      <action type="Redirect" url="{R:0}" redirectType="Permanent" />  </rule> 

and finally this is the error I receive after 2-3 minutes:

This site can’t be reached refused to connect.