Fix login/logout redirects for sites with a URL prefix.