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?
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?
Try this:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { var options = new RewriteOptions() .AddRedirectToHttps(); app.UseRewriter(options); } Read more here .
Source: https://ru.stackoverflow.com/questions/876315/
All Articles