This is probably a simple question but I just can't get it to work.
I've got this route specified in my RouteConfig
routes.MapRoute(
name: "DefaultSiteRoute",
url: "{accountid}/{hostname}/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, accountid = UrlParameter.Optional, hostname = UrlParameter.Optional }
);
And it works fine for a url like this
/123456/www.test.com/
or this
/123456/www.test.com/Controller/Action
but it can't cope with this
/123456/www.test.com
I get an IIS 404
What is stranger is if I call Url.Action
for that route with the default Controller and Action (ie Home/Index) it creates a url without a trailing slash, which it then doesn't recognise. I really need it to work with and without the trailing slash.