Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Rud 261 posts 1002 karma points c-trib
    Apr 27, 2022 @ 04:07
    Martin Rud
    0

    Umbraco 8 on localhost: /umbraco/ redirects to https://localhost/umbraco/ (removes port number and adds https)

    Hi forum,

    I have taken over a new customers website and I am trying to establish a local dev environment. Frontend runs fine, but when I try to enter backend (http://localhost:23060/umbraco/) it redirects to https://localhost/umbraco/ (i.e. a redirect removes port number and adds https) and then I get:

    This site can’t be reachedlocalhost refused to connect. Try:

    Checking the connection Checking the proxy and the firewall ERRCONNECTIONREFUSED

    I am using IIS Express.

    I have tried all variations of the below and then flushed DNS (chrome://net-internals/#dns), but nothing helps.

    Uncommented parts or all of this:

        <rewrite>
          <rules>
    <!--
            <rule name="HTTP to HTTPS redirect" stopProcessing="true">
              <match url="(.*)" />
              <conditions>
                <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
              </conditions>
              <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
            </rule>
            <rule name="Force non-WWW" stopProcessing="true" enabled="true">
              <match url="(.*)" />
              <conditions logicalGrouping="MatchAny">
                <add input="{HTTP_HOST}" pattern="^www\.(.*)$" />
              </conditions>
              <action type="Redirect" url="https://{C:1}/{R:1}" redirectType="Permanent" />
            </rule>
    -->
          </rules>
        </rewrite>
    

    Added umbracoUseSSL = false

    <appSettings>
      <add key="umbracoUseSSL" value="false" />
    </appSettings>
    
  • Martin Rud 261 posts 1002 karma points c-trib
    Apr 27, 2022 @ 04:16
    Martin Rud
    100

    UPDATE!

    Problem is not that big anymore, since when running ISS Express from Visial Studio 2019 the Umbraco backend runs fine. The problem is only occuring when running ISS Express from VS Code.

    So I have a solution - but I would be nice to know the reason for the problem in VS Code. :)

  • Bobi 352 posts 956 karma points
    Apr 27, 2022 @ 05:25
    Bobi
    0

    Hi,

    Some thoughts to assist troubleshooting:

    1) Is there any IIS .config file being used where rewrites are occurring outside of the web.config?

    2) Is there a different IIS configuration being used on your localhost which VS 2019 is using and VS code is not?

    3) Have you checked the IIS rewrite rules in your IIS configuration. Perhaps there is something in there causing rewrites?

  • Martin Rud 261 posts 1002 karma points c-trib
    Apr 27, 2022 @ 07:22
    Martin Rud
    0

    Haven´t checked, but my other sites work with VS Code and IIS Express, so I guess that's not the reason.

    For now I just go with Visual Studio. :)

Please Sign in or register to post replies

Write your reply to:

Draft