0

I want all requests to http://foo.com/test/{the-rest-of-the-url} to map to http://foo.com/{the-rest-of-the-url}

Something like this...

        routes.MapRoute(
            name: "Test",
            url: "test/{controller}/{action}/{id}",
            defaults: new { controller = "Channel", action = "Index", id = UrlParameter.Optional }
        );

But of course that did not work.

HarryTuttle
  • 180
  • 1
  • 8
  • 1
    Possible duplicate of [ASP.NET MVC - Removing controller name from URL](https://stackoverflow.com/questions/3337372/asp-net-mvc-removing-controller-name-from-url) – Tetsuya Yamamoto Nov 14 '18 at 02:08
  • What is the `{the-rest-of-the-url}`? Does it contain segments for the controller and action name or is it just the value for `id`? –  Nov 14 '18 at 02:09
  • For ignoring action name, see [this issue](https://stackoverflow.com/questions/33716438/asp-net-removing-the-action-name-from-the-url), depending on which name you want to ignore. – Tetsuya Yamamoto Nov 14 '18 at 02:15

0 Answers0