diff --git a/app/modules/http-utils/remove-slashes.ts b/app/modules/http-utils/remove-slashes.ts index 4cfe90b5..49f04974 100644 --- a/app/modules/http-utils/remove-slashes.ts +++ b/app/modules/http-utils/remove-slashes.ts @@ -3,6 +3,7 @@ import { redirect } from "@remix-run/node"; export async function removeTrailingSlashes(request: Request) { let url = new URL(request.url); if (url.pathname.endsWith("/") && url.pathname !== "/") { - throw redirect(url.pathname.slice(0, -1) + url.search); + url.pathname = url.pathname.slice(0, -1); + throw redirect(url.toString()); } }