I have modified my routing to include the culture in the URL
routes.MapRoute(
name: "Default",
url: "{culture}/{controller}/{action}/{id}",
defaults: new { culture = "en-GB", controller = "StyleGuide", action = "Template", id = UrlParameter.Optional },
constraints: new { culture = @"[a-z]{2}-[A-Z]{2}" }
);
I have also created ErrorController and defined my error pages in Web.config:
<customErrors mode="On" defaultRedirect="~/Error/Index">
<error statusCode="404" redirect="~/Error/NotFound"/>
</customErrors>
I am also using mvcSiteMapProvider, so I have included my new error pages and am able to access them via the menu as it uses a URL that includes my culture: localhost/en-GB/Error/NotFound
When an exception is thrown the error pages aren't being found because the culture is missing from the redirects defined in Web.Config.
How can I include the culture when redirecting to my error pages?