© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
19 replies
reeeeeee

❔ Remove Index from URL

How do I remove "Index" from Url, so I can call
/Home
/Home
,
/Users
/Users
, etc, wihtout additional
/index
/index
. (but obv be still redirected to "Index" method in controller.
I found this snipped and added it to my startup
endpoints.MapControllerRoute(
                   name: "default",
                   pattern: "{controller}/{action}/{id?}");
endpoints.MapControllerRoute(
                   name: "default",
                   pattern: "{controller}/{action}/{id?}");

Well, the Index is still there, and all actions without "Index" are redirected to my
Users/edit/{id}
Users/edit/{id}
action..
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

How can i remove a substring from index i to first index of a or b character
C#CC# / help
3y ago
✅ Remove tags from string
C#CC# / help
4y ago
❔ ✅ remove from list (RevitAPI)
C#CC# / help
4y ago