HttpsRedirectionMiddleware
HttpsRedirectionMiddleware is ASP.NET Core middleware that redirects eligible HTTP requests to their corresponding HTTPS URLs.
ASP.NET Core in Action, 3e
HttpsRedirectionMiddleware is ASP.NET Core middleware that redirects HTTP requests to their HTTPS equivalents.
- How it is used
- Enforces HTTPS across an ASP.NET Core application by redirecting incoming HTTP requests to secure endpoints.
- How deep it goes
- Explains registration, pipeline behavior, status codes, endpoint selection, missing configuration, and alternate-port configuration.
- Examples
- Uses Program.cs registration, a 307 redirect, an absent-port warning, and ASPNETCORE_HTTPS_PORT configuration as concrete examples.
- What you can do after
- Operate/configure HTTPS redirection in an ASP.NET Core pipeline and diagnose missing HTTPS endpoint or port configuration.
Read how ASP.NET Core in Action, 3e explains HttpsRedirectionMiddleware →
.NET in Action, Second Edition
UseHttpsRedirection is ASP.NET Core middleware configuration that redirects HTTP requests to HTTPS URLs.
- How it is used
- Redirects HTTP requests to HTTPS in an ASP.NET Core service.
- How deep it goes
- Explains configuration, 307 behavior, certificates, and production alternatives, but defers broader HTTPS defaults.
- Examples
- Uses Program.cs, Swagger’s localhost URL, a 307 response, a Location header, and the dotnet dev-certs command.
- What you can do after
- Operate/configure HTTPS redirection and verify its redirect response during development.
Read how .NET in Action, Second Edition explains HttpsRedirectionMiddleware →
Related concepts
- http redirectimplements · An HTTP redirect is a response that instructs a client to request or display a resource at a different location.
- middlewarekind of · Middleware is an intermediate software component or layer that processes or mediates requests, messages, or operations between other components, often adding behavior or controlling their flow.
- HTTPS redirectionimplements · HTTPS redirection is the practice of responding to HTTP requests by redirecting clients to the corresponding HTTPS URL.
- request pipelinepart of · A request pipeline is an ordered sequence of processing components through which HTTP requests and their responses pass in a web application.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

