2

I created an areas -> Admin.

In my register area, I have:

public override void RegisterArea(AreaRegistrationContext context)
{
    context.MapRoute(
        "Admin_default",
        "Admin/{controller}/{action}/{id}",
        new { action = "Index", id = UrlParameter.Optional }
    );
}

I changed it to:

context.MapRoute(
    "jojo",
    "jojo/{controller}/{action}/{id}",
    new { action = "Index", id = UrlParameter.Optional }
);

Now if you type in a URL, xxx/jojo/AdminHome/Index, it works perfectly, but how can I change the controller and action names until the user can not finds that it's going to the admin area. Notice that I do not want change my controller name to jojo, for example.

Is it possible?

3
  • 1
    Your question is extremely unclear. Commented Oct 19, 2011 at 20:12
  • i mean how can i change my controller and action name from real (class name) to fake name until hackers can not realize real names Commented Oct 19, 2011 at 20:18
  • There is no point in doing that. Security by obscurity is generally useless. Instead, use authentication and SSL. (And don't allow XSS or SQL injection) Commented Oct 19, 2011 at 20:22

1 Answer 1

4

You can do this:

context.MapRoute(
    "jojo",
    "jojo/jojo/{action}/{id}",
    new { controller="RealController", action = "Index", id = UrlParameter.Optional }
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.