There is a method that redirects to HTTPS and is defined in the Startup file.

UseHttpsRedirection() 

But it only works with Core 2.1. My host does not yet support this version. Are there any adequate alternatives?

    1 answer 1

    Try this:

     public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { var options = new RewriteOptions() .AddRedirectToHttps(); app.UseRewriter(options); } 

    Read more here .

    • I try to debug in my locale, there is a redirect to https but it says that I check the connection to the Internet and eventually does not start, I comment the lines, it starts. Where can there be a god? - FX_Sektor
    • Yes, I reloaded the site, everything works. Thank! - FX_Sektor