Http: // localhost: the port is always redirected to https: // localhost

I am creating a simple website in vs2015. I chose IIS Express as the hosting environment. I tried several new projects and seemed to go around in circles, installed and uninstalled iis-express 10 times, and also added and removed the iis windows function. When I started the web project with vs2015, it used to open (without problems) the http: // localhost: port (for example, http: // localhost: 51898 ), but now it constantly redirects to https: // localhost .

Any ideas why?

+6
source share
3 answers

IIS asp.net .

  • loo
    • ApplicationHost.Config, web.config(C:\Windows\System32\inetsrv\config) httpRedirect

. <httpRedirect enabled="true" destination="https://localhost" />

  • urlrewrite. :

                                       

                <action type="Redirect" url="http://www.maindomain.com/{R:1}" />
            </rule>
    
    • , .
+1

Visual Studio, Chrome. : Google Chrome localhost https

+1

:

services.Configure<MvcOptions>(options =>
{
    options.Filters.Add(new RequireHttpsAttribute());
});

In any case, double-check the startup.cs file. Maybe configurations are part of the problem

0
source

Source: https://habr.com/ru/post/1682339/


All Articles