© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago
Pokey

Mapping controller to / without breaking other controllers

Hi there,

I would like to rename
HomeController
HomeController
to
DefaultController
DefaultController
and instead of going to
/Default/Action
/Default/Action
I would like to go to
/Action
/Action


This should be simple, but I do not want to break routing for other controllers. The order of importance I wish to follow is controller name and then
DefaultController
DefaultController
action name (If there is a
DefaultController.Dashboard
DefaultController.Dashboard
action and a
DashboardController.Index
DashboardController.Index
action I would like
DashboardController.Index
DashboardController.Index
to take priority)

How might I best configure one or more
MapControllerRoute
MapControllerRoute
entries to permit this?

Thanks!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ CQRS with MediatR without Controllers
C#CC# / help
4y ago
EF Core mapping to Viewmodels without duplicating viewmodels
C#CC# / help
6mo ago
Controllers purpose
C#CC# / help
4y ago
✅ Understanding how to build controllers.
C#CC# / help
4mo ago