Fixed web UI redirection.

 - use HTTP status code 302.
 - set Access-Control-Allow-Origin header appropriately.

@florianleibert @guenter