locked
www translates to https://www in ASP.NET 4.0 Web Application RRS feed

  • Question

  • User2112578478 posted

    I have a web application that I have deployed to a server for pre-production testing. It is not yet on a secure certificate but will be once the testing is completed.

    Yesterday I moved a new build of the full site up and suddenly, the call to the site was redirecting it to https: and informing me through the browser that the site is not secure. When I choose to continue anyway I get a 404 error.

    What would cause a normal call to a www to switch to https? The funny thing is that I can run this on the server itself if I browse from within the IIS manager, although this is not going through the DNS to resolve the www.

    The test URL is www.phanetworktest.com.

    Any ideas on where this is being controlled. I don't have any forced redirects in the Web.Config.

    Thanks!

    Thursday, May 10, 2018 1:49 PM

All replies

  • User283571144 posted

    Hi hampdentech,

    After accessing the test url, I found the 302 status codes in the browser's network folder.

    The image as below:

    I guess you have enable the url redirect in your IIS setting.

    I suggest you could find the applicationhost.config file to check you have enable the IIS redirect rule.

    The config path is

    C:\Windows\System32\inetsrv\Config\applicationHost.config

    I suggest you could delete below config code.

            <rewrite>
                <globalRules>
                    <rule name="test" patternSyntax="Wildcard" stopProcessing="true">
                        <match url="*" />
                        <conditions>
                            <add input="{HTTPS}" pattern="off" />
                        </conditions>
                        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
                    </rule>
                </globalRules>
            </rewrite>

    Best Regards,

    Brando

    Friday, May 11, 2018 5:32 AM
  • User2112578478 posted

    Thanks for the reply!

    Okay, I can see what you are saying, and I have not checked the applicationhost.config file yet, however, this does not explain why this was working before I moved in the new update. Previously, navigating to http://www.phanetworktest.com worked fine. Also, I have other sites hosted under the same IIS server that do not use certificates, and they are working fine.

    Friday, May 11, 2018 1:50 PM
  • User283571144 posted

    Hi hampdentech,

    According to your description, I suggest you could try to republish your web application to a new web application in IIS without bind with the domain.

    If it doesn't auto redirect from http to https, I guess this may related with your domain setting.

    Best Regards,

    Brando

     

     

    Saturday, May 12, 2018 5:33 AM
  • User2112578478 posted

    Okay, here's the latest update. 

    This morning I moved the latest version of this application up after a new build. It is no longer redirecting to https when I try to browse http://www.phanetworktest.com, however, it still gives me an error about the site being unsecured. When I attempt to bypass this I get an Error 404.

    When I browse to phanetwork46.phanetwork.net I get the website, however, I am initially redirected to the login page. I have to sign in here, and once I login successfully, it takes me to our "Entrance" page where all users go prior to authorization. When I sign in there, I again get the login page and once I sign in again, I am brought into the authenticated area of the website.

    On my development machine, same app, I get the unauthorized "Entrance" page first, then sign in as normal. This is how it is supposed to work.

    So, neither Url on the production server is working 100% correct, however, the phanetwork46.phanetwork.net Url at least gets me in.

    I need to resolve this pretty soon as we need to make this the production version of our application before May 25th. Any help on this would be appreciated!

    Tuesday, May 15, 2018 6:32 PM