I need to build a c# MVC portal that is localized.
I have the following route defined:
routes.MapRoute(
name: "DefaultLocalized",
url: "{lang}/{controller}/{action}/{id}",
constraints: new { lang = @"(\w{2})|(\w{2}-\w{2})" }, // en or en-US
defaults: new { controller = "Home", action = "Index", id =
UrlParameter.Optional }
);
Also implemented a LocalizedControllerActivator.
All works great.
Defaults urls:
When language changed to German it routes to
that is great.
The issue I have is with images.
for the following line
<img src="media/images/backgrounds/bg.jpg" alt="Smiley face" height="42"
width="42">
it would resolve to http://test/de/media/images/backgrounds/aria_bg3.jpg
I would like to simply use
http://test/media/images/backgrounds/bg3.jpg
and ignore the language string all together
or I would like to have a different structure like
http://test/media/de/images/backgrounds/bg3.jpg
Any help would be appreciated.
Thanks, Moz