I have ASP.NET 4 project (not MVC). I need to create url route based on user input language.
Project has only two languages “he” and “en”.
User can enter the site and if his culture is set to anything besides he-IL i want to re-route him to website.com/en/ otherwise to website.com/he/
Default.aspx should remain same page which uses Globalization features translate values based on user’s culture settings in browser.
How can i do that? what should i do besides writing a route in Global.asax and How to write this route.
Seems like you are trying to do something unintended with Routing.
If the language in URL does nothing and you need for it to appear in URL only then you either make hackish solution with HTTP modules rewriting urls to remove it and add back to generated html or simply map the same site to two virtual folders /en and /he in IIS and make a simple Default.aspx page at / to redirect to appropriate one based on user culture.