From 6dc91b4d50231320e0b076e5675875d7b00d61be Mon Sep 17 00:00:00 2001 From: Ramon Hansman <> Date: Wed, 20 Mar 2024 17:41:50 +0100 Subject: [PATCH] toRelativeUrl returns proper relative url in case of root site --- src/helpers/GeneralHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/GeneralHelper.ts b/src/helpers/GeneralHelper.ts index e43e773e..9a288136 100644 --- a/src/helpers/GeneralHelper.ts +++ b/src/helpers/GeneralHelper.ts @@ -356,5 +356,5 @@ export const toRelativeUrl = (absoluteUrl: string): string => { return ''; } - return absoluteUrl.replace(/^(?:\/\/|[^/]+)*\//, '/'); + return new URL(absoluteUrl).pathname; };