From 417d07315feadd8efa5f7ad09934090c59dfddeb Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Mon, 27 Oct 2025 22:28:24 +0800 Subject: [PATCH 1/3] chore: add new redirect rule for /authorization/api-resources --- static/_redirects-docs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/_redirects-docs b/static/_redirects-docs index 473aa965ff5..dccf20b4ed1 100644 --- a/static/_redirects-docs +++ b/static/_redirects-docs @@ -292,3 +292,5 @@ /end-user-flows/security-verification/by-management-api/ /end-user-flows/security-verification 301 /end-user-flows/security-verification/by-account-api /end-user-flows/security-verification 301 /end-user-flows/security-verification/by-account-api/ /end-user-flows/security-verification 301 +/authorization/api-resources /authorization/global-api-resources 301 +/authorization/api-resources/ /authorization/global-api-resources 301 From 24da03d082e3cf69e0f21cfc1b0144c6a1ee6d0a Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Mon, 27 Oct 2025 23:34:06 +0800 Subject: [PATCH 2/3] chore: update redirect rule for default api --- static/_redirects-docs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/_redirects-docs b/static/_redirects-docs index dccf20b4ed1..7e2b139e825 100644 --- a/static/_redirects-docs +++ b/static/_redirects-docs @@ -231,6 +231,8 @@ /docs/references/openid-connect/signing-keys-rotation/ /developers/signing-keys 301 /docs/references/resources /authorization/global-api-resources 301 /docs/references/resources/ /authorization/global-api-resources 301 +/docs/references/resources#default-api /authorization/role-based-access-control#default-api-resource-behavior +/docs/references/resources/#default-api /authorization/role-based-access-control#default-api-resource-behavior /docs/references/sdk-convention /developers/sdk-conventions 301 /docs/references/sdk-convention/ /developers/sdk-conventions 301 /docs/references/sdk-convention/core-sdk-convention /developers/sdk-conventions/core-sdk-convention 301 From de5b0edee7be9fea146cf5b0fb2c00095ce08713 Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Tue, 28 Oct 2025 09:55:45 +0800 Subject: [PATCH 3/3] chore: support hash parameter in the redirect URL test script --- static/_redirects-docs | 2 +- test-redirects.mjs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/static/_redirects-docs b/static/_redirects-docs index 7e2b139e825..418c30f90af 100644 --- a/static/_redirects-docs +++ b/static/_redirects-docs @@ -243,8 +243,8 @@ /docs/references/sdk-convention/platform-sdk-convention/ /developers/sdk-conventions/platform-sdk-convention 301 /docs/references/tenants /logto-cloud/tenant-settings 301 /docs/references/tenants/ /logto-cloud/tenant-settings 301 +/docs/references/tenants#tenant-types /logto-cloud/tenant-settings#tenant-types-dev-vs-prod 301 /docs/references/tenants/#tenant-types /logto-cloud/tenant-settings#tenant-types-dev-vs-prod 301 -/docs/references/tenants/#tenant-types/ /logto-cloud/tenant-settings#tenant-types-dev-vs-prod 301 /docs/references/tenant-type /logto-cloud/tenant-settings/#tenant-types-dev-vs-prod 301 /docs/references/tenant-type/ /logto-cloud/tenant-settings/#tenant-types-dev-vs-prod 301 /docs/references/translate-cli /logto-oss/translate-cli 301 diff --git a/test-redirects.mjs b/test-redirects.mjs index b812c595cd3..dbb45448871 100644 --- a/test-redirects.mjs +++ b/test-redirects.mjs @@ -40,7 +40,14 @@ for (const [from, to] of entries) { continue; } - const mappedFrom = from.endsWith('/') ? from.slice(0, -1) : from + '/'; + // Support "from" entries that include a hash fragment by toggling the trailing + // slash on the path portion only, then re-attaching the original fragment. + const hashIndex = from.indexOf('#'); + const baseFrom = hashIndex >= 0 ? from.slice(0, hashIndex) : from; + const fragment = hashIndex >= 0 ? from.slice(hashIndex) : ''; + + const toggledBase = baseFrom.endsWith('/') ? baseFrom.slice(0, -1) : baseFrom + '/'; + const mappedFrom = `${toggledBase}${fragment}`; const mappedTo = entries.get(mappedFrom); if (!mappedTo) {