Fixing redirects with relative links and query parameters