How to make route urls lowercase in ASP.NET
Beauty is in the eye of the beholder. But let's all agree, Pascal Cased url routes are ugly.
Unfortanately, it's the default for route urls in ASP.NET. Here is how to change it to lowercase.
In your program.cs
, add the following route options…
builder.Services.Configure<RouteOptions>(options =>
{
options.LowercaseUrls = true;
});
Now your default route urls will be lowercased. For example, instead of https://dotnetdevs.co/Blog
, it's https://dotnetdevs.co/blog
.