forum

Home / DeveloperSection / Forums / How to achive MVC route with numbers

How to achive MVC route with numbers

Anonymous User 1824 26-Dec-2014

I am trying to route an old URL that is domain.com/1024 to my home page in mvc.

I keep getting resource not found errors.

Here is my routeConfig

        routes.MapRoute(
        name: "1024",
        url: "{controller}/{action}",
        defaults: new { controller = "Home", action = "Direct", id = UrlParameter.Optional }
    );

 My Controller 

    public ActionResult Direct()
    {
 
        return RedirectToAction("Index");
    }


Updated on 26-Dec-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By