added correct redirection logic
Merge branch 'https-for-remote-api' of https://github.com/AppScale/appscale into https-for-remote-api