Not sure what you mean by 'redirected before the redirection occurs', but you can create your own redirection handler and replace the default one. Then you can handle the Location
header however you like. In any case if the default one doesn't handle it correctly, it most likely some server misconfiguration. Here's the interface an the default implementation for reference:
http://developer.android.com/reference/org/apache/http/client/RedirectHandler.html
http://developer.android.com/reference/org/apache/http/impl/client/DefaultRedirectHandler.html