For some reason Java doesn’t like to obey http forwards if the protocol is changing. It has been this way for a while:  So when I was trying to load that had an apache redirectMatch to, I would get the html for the 301 redirect instead of the source of

I was lucky that I have control over the server and could change the http/https to a simply proxy instead of redirecting.  If I didn’t, I would have had to catch the protocol change and refetch the new url.

It took me a while to find an answer for this because these keywords didn’t give many results on google: URLConnection HttpURLConnection openConnection() connect() getInputStream() Apache redirectMatch 301 302.

This is in the babble category tagged as ,


2 Responses

  1. Flexo Says:

    Is there any way to solve that problem?
    I only found forum threads and blogs which all refer to the sun bug site. So this means it does not work at all?

  2. Aracos Says:

    Found an articel relating to this problem at that helped me

Leave a Comment

Your comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.