سلام. استاد چجوری مشه تو asp core
http به https ریدایرکت کرد
ممنون
سلام
// IHostingEnvironment (stored in _env) is injected into the Startup class.
if (!_hostingEnvironment.IsDevelopment())
{
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
}
if (env.IsDevelopment())
{
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// todo: replace with app.UseHsts(); once the feature will be stable
app.UseRewriter(new RewriteOptions().AddRedirectToHttps(StatusCodes.Status301MovedPermanently, 443));
}