On an ASP.NET Core project I have the following route:
public class AboutController : Controller {
[HttpGet("about-us")]
public IActionResult Index() => View();
}
How to make this url the default homepage of the site?
So when I access www.mydomain.com I am automatically redirected to www.mydomain.com/about-us
Is this possible in ASP.NET Core or do I need to do this on the domain DNS?
You may add a redirect rule using the URL Rewriting Middleware:
var option = new RewriteOptions();
option.AddRedirect("^$", "about-us");
app.UseRewriter(option);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With