Best practices on enforcing WWW prefix or no prefix?
16:35 16 Jun 2026

I see Razor Pages offers (and enables by default) app.UseHttpsRedirection(). But there is no app.UseWwwRedirection() or, better still, a method that handles both cases in a single redirect (as Microsoft has provided in earlier versions of ASP.NET).

Since normalizing on the www prefix, or lack thereof, is an important SEO consideration, are there best practices when it comes to ensuring your web application always uses one of these?

c# asp.net-core razor-pages