I have created a redirect rules in my web.config to redirect my website from http to https. The issue i have is that every single link on the website is now https. I have a
In ASP.NET Core 2.2 you should use Startup.cs settings for redirect http to https
so add this in ConfigureServices:
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpsRedirection(options =>
{
options.HttpsPort = 443;
}); // ===== Add this =====
}
and add this in Configure :
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts(); // ===== Add this =====
}
app.UseHttpsRedirection(); // ===== Add this =====
}
then enjoy it.