When we try to hit google.com from India, it routes to google.co.in Similary, In my Asp.Net web application, I would like to redirect the websites based on client's geography. Where should this be handled? Can this be handled in Web.config or should I create any custom Http handlers. Please help.
1 Answers
This is not routing in strict sense it is a redirect to another domain. Assume that you have domain.com as top domain level ...now for each domain u can have more than one extensione like .net .ca .us .fr .br .br and so on. Now assume that a customer browsing domain.com(which is USA based in example) and he is come from india we can intercept some stuff from its webbrowser like language etc and decide to REDIRECT it to domain.co.in....which is a little bit different from routing.
Routing: assume that you have a domain with some url and you can use custom path to show to a user a particulare page with different url in example :
http://domain.com/account/login is our friendly url but when a customer go to that url the same one will see http://domain.com/account/login as url but in realty we will match that url with a phisical path like http://domain.com/protected/customer/login.aspx or any other link that we need to match.
Assume that you have this folder structure in your website :
httpdocs/account/private/customer/login.aspx httpdocs/account/private/customer/manage.aspx httpdocs/account/private/customer/delete.aspx
each of those phisical path in a normal url structure will be presented like
domain.com/account/private/customer/login.aspx and as friendly url, with routing could be domain.com/login or domain.com/customer/login or anything you like.
Routing is used to make url more simply to read and to make seo too.
That's all :)
To move from one domain like domain.com to domain.co.in based on languages or any other stuff you need to match it with webbrowser capabilities and choose what you need to do.
I hope that is clear :)
PS excuse me for my poor english but i'm italian :)

- 1,222
- 10
- 11