0

I have a HomeController.cs with some actions and can access these via http://localhost/MyWebSite/Home/Test
I'd like to shorten the URL to http://localhost/MyWebSite/Test
Therefor I added following code to the RouteConfig.RegisterRoutes method

routes.MapRoute(
    name: "ShortendUrl",
    url: "{action}",
    defaults: new { controller = "Home", action = "Test" }
);

When trying to access it via http://localhost/MyWebSite/Test I see

HTTP-Error 403.14 - Forbidden

Where is my mistake? Is the MapRoute wrong? or is it maybe an issue at the IIS configuration?

For reference I used this blog entry: http://weblogs.asp.net/gunnarpeipman/asp-net-mvc-defining-short-urls-for-root-level-pages

Tom
  • 195
  • 9
  • It would need to be `url: "Test",` in order for your route to work (and it would need to be placed before the Default route –  Jul 21 '16 at 09:30
  • Placing it before default seemed a good idea, unfortuantely both didn't help. – Tom Jul 21 '16 at 10:00
  • Suggest you look at the answers [here](http://stackoverflow.com/questions/1741439/asp-mvc-in-iis-7-results-in-http-error-403-14-forbidden) for some potential causes –  Jul 21 '16 at 10:06

0 Answers0