stevegray
4Penny.net
Points: 64459

4/25/2026 10:31:53 AM

Redirect to https in the web.config

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

There’s a special kind of irritation that only web developers know: you hit F5 in Visual Studio expecting a friendly little http://localhost:12345, and instead your browser lunges straight into HTTPS like it’s late for a security audit. Suddenly you’re staring at a certificate warning, your cookies don’t match, and your dev environment feels like it’s cosplaying as production.

The culprit is almost always the same—a well-intentioned rewrite rule that does exactly what you told it to do, not what you meant for it to do.

If you’ve ever wondered why your local site keeps force-redirecting to HTTPS even though you never asked for it, this post walks through the exact reason, the fix, and the cleanest way to keep production locked down without making development annoying.

4Penny.net
Version: All
Section: .NET Development
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3