I am working on a multilingual website where the URL will contain the language code:
/en/Home
/es/Home
Whenever someone enters a url that does not have the language code at the beginning (/Home), I would like to do a 301 redirect to the url (route) they entered but append the language code at the beginning. I will determine the language to redirect to based on the language setting of their browser (HttpContext.Request.UserLanguages).
Since I will have logic within MVC, I cannot use the IIS7 URL rewriting.
I am not sure if it would be best to create a custom HttpHandler or RouteHandler or something else.