Fix redirects to properly escape URLs in HTML