Fix redirects and referer