My application is a very simple MVC 5 website with several controllers. I have a Home controller with an Index action like this:
public ActionResult Index(string token)
{
DoSomethingWithTheToken(token);
return View();
}
Now, supossing my website is www.my-special-website.com I'd want www.my-own-purpose-website.com/abcdefghijklmno to be served by the Index method.
According to the information available in https://msdn.microsoft.com/en-us/library/cc668201.aspx I set up this routes:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Home",
url: "{token}",
defaults: new { controller = "Home", action = "Index", token = "{token}" });
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
Unfortunately, when I navigate to www.my-special-website.com/abcdefghijklmno, I get a "404 resource not found" response.
Who can I make it land to the desired controller and pass the token parameter?