If this is not possible, this kludge will fix the problem:
do_sync in Protocols/HTTP/Session.pike:
while( con->status == 100 )
con->ponder_answer( con->datapos );
if (con->status>=300 && con->status<400 &&
con->headers->location && follow_redirects)
{
+ string a,b,c;
+ if (sscanf(con->headers->location,"%s://%s?%s",a,b,c)==3 &&
+ search(b,"/")==-1)
+ con->headers->location=a+"://"+b+"/?"+c;
Standards.URI loc=
Standards.URI(con->headers->location,url_requested);
if(loc->scheme=="http" || loc->scheme=="https")