Better handling of 30X HTTP status codes

Reference: http://greenbytes.de/tech/tc/httpredirects/