File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes URL Redirect to Country domain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "URL Redirect to Country domain" Watch "URL Redirect to Country domain" New topic

URL Redirect to Country domain

Ragupathirajan Venkatesan
Ranch Hand

Joined: Aug 18, 2010
Posts: 62
Hi Friends,

When we enter the URL of any enterprise application which is getting used all over the world, it will be redirected to country domain like ( How this is happening? From where they are getting the information about the country of the end users? is it from the browser request to the server or from any Web server to which the request is getting pointed.

Please post your ideas and drop a note regarding which is better to get such info in order to redirect the url.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

They know the IP for your machine (they need this so they can send you whatever you are requesting). From that, it is not too hard to figure out a general idea of where you are.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ragupathirajan Venkatesan
Ranch Hand

Joined: Aug 18, 2010
Posts: 62

Thanks for your response. I agree that we can get the ip address of the client and from there we can get all the required details, but please consider me as fresher and post your ideas like how they are gettign the IP address from the request and how they are obtaining the locale information. Just by giving any sample or example.

I am trying to understand the back end logic rather having the assumptions.

Thanks in advance
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

All java based web servers use HTTPServletRequest to get information about the requestor and the request.
to elaborate.. a server's job is to respond to requests sent by clients.

"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
I agree. Here's the link:
subject: URL Redirect to Country domain
jQuery in Action, 3rd edition