Q:

ASP.NET MVC 5 routing restriction

I've updated my code to use Area as suggested but the problem still exist. /dashboard is still available.
My Controllers folder has HomeController and AccountController. I have Areas/Admin/Controllers/DashboardController.cs
Problem:

My area admin controller can be accessed like this /admin/dashboard, but the problem is it can also be accessed using /dashboard -> this should show 404

here is my RouteConfig:
routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "project.Controllers" }
            );

AdminAreaRegistration:
public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "project.Areas.Admin.Controllers" }
            );

        }

A:

The /dashboard call is routed by the Default routing rule.
You can make the Default not to process the calls made to the dashboard controller by adding a constraint.
For example:
In the default routing rule you can add a constraint like the following:
routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    namespaces: new[] { "project.Controllers" },
    constraints: new { controller = new Constraints.IsNotDashboard() }
);

Then, you can declare the constraint like this:
using System.Web;
using System.Web.Routing;

public class IsNotDashboard : IRouteConstraint
{
    public IsNotDashboard()
    {
    }

    public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
    {
        string controller = values["controller"].ToString().ToLower();

        return controller != "dashboard";
    }
}

With this constraint, all calls that match the dashboard controller will not be processed by the Default routing rule. 

