Finding Redirect Location
843842Sep 18 2008 — edited Sep 22 2008I'm writing an application that fetches a web page and changes the links of the page so that it goes through a proxy to clean up the page to be formatted for cell phones. Everything is working except when I encounter a site that redirects me to a local domain. ie If I go to http://bob.com and bob.com redirects me to http://bob.com/mobile how can I get the "/mobile" to store in a variable.
The application returns the page so there has to be some type of mechanism to get that redirect. I am using apaches HttpClient to make my connection. When I use getHost() it just returns the domain name. Anybody know how to solve this? Thanks in advance.