Copied to clipboard

Flag this post as spam?

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


  • MB 273 posts 936 karma points
    Oct 08, 2018 @ 14:33
    MB
    0

    Can't access administration locally (port removed from URL)

    Hi guys,

    I'm running Umbraco 7.11.1

    Not too long ago I added https certificate through Unoeuro to my site. It worked just great, I also used this snippet to redirect to the https:

    <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="Strip www. from URL" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{HTTP_HOST}" pattern="^www\.(.+)$" />
                    </conditions>
                    <action type="Redirect" url="http://{C:1}/{R:1}" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
    

    However, when I open the site in VS Community 2017 and attempt to access http://localhost:52242/umbraco it removes the port and attemps to access https://localhost/umbraco which of course returns an error.

    I attempted to remove the snippet provided above and re-build my solution but with no success.

    The way I run my site is through visual studio itself, not through the IIS.

    Any idea why I can't access the database locally?

    // Mike

  • Nigel Wilson 945 posts 2077 karma points
    Oct 08, 2018 @ 20:24
    Nigel Wilson
    0

    Hi MBE

    When you say rebuild the solution locally, are you saying the build fails, or does it build but you can't access the database ?

    If it fails to build then please provide the error message(s) returned from Visual Studio.

    If it does build, have you got the right dB connection parameters for your local database ?

    Cheers, Nigel

  • MB 273 posts 936 karma points
    Oct 09, 2018 @ 18:06
    MB
    0

    Hi Nigel,

    Thank you for helping me out.

    When I re-build the entire project there's no errors. My connectionstring looks like this:

        <connectionStrings>
        <remove name="umbracoDbDSN" />
        <add name="umbracoDbDSN" connectionString="Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0" />
        <!-- Important: If you're upgrading Umbraco, do not clear the connection string / provider name during your web.config merge. -->
    </connectionStrings>
    

    But the thing is, when I access the website locally it works perfectly fine at http://localhost:52242/default.aspx, the site is shown.

    But when I access http://localhost:52242/umbraco it strips the port and goes to HTTPS as shown here: https://localhost/umbraco

    I can't seem to figure out what causes Umbraco to redirect to HTTPS and without the port.

    // Mike

  • Nigel Wilson 945 posts 2077 karma points
    Oct 09, 2018 @ 20:08
    Nigel Wilson
    0

    Hi MBE

    Have you tried different browsers (Chrome can be a bit of a kleptomaniac with URL's) or incognito ?

    Nigel

  • Alex Sosa 17 posts 142 karma points
    Oct 09, 2018 @ 20:11
    Alex Sosa
    104

    Hi there,

    I had this error before and the issue for me was that on the web.config the setting for umbracoUseSSL was set to true instead of false, hope this helps

  • MB 273 posts 936 karma points
    Oct 12, 2018 @ 14:50
    MB
    0

    That did it! Thanks for the help guys! :)

  • Prasad kumarasinghe 4 posts 74 karma points
    Nov 18, 2019 @ 08:19
    Prasad kumarasinghe
    0

    Wow!it worked for me as well, thanks a lot.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies