diff --git a/redirects.ts b/redirects.ts index c3a3fd13..7fabdf84 100644 --- a/redirects.ts +++ b/redirects.ts @@ -170,13 +170,15 @@ function generateDocsRedirects(basePath: string): RedirectRule[] { { from: withBase('/audit-logging'), to: withBase('/administration/logging/audit-logging') }, { from: withBase('/jobs'), to: withBase('/administration/jobs') }, { from: withBase('/upgrade-hdb-instance'), to: withBase('/deployments/upgrade-hdb-instance') }, - { from: withBase('/reference'), to: withBase('/reference/') }, { from: withBase('/operations-api'), to: withBase('/developers/operations-api/') }, { from: withBase('/rest'), to: withBase('/developers/rest') }, { from: withBase('/api'), to: withBase('/developers/operations-api/') }, // File rename redirect - { from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') } + { from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') }, + + // Old Technical Details -> Reference paths + { from: withBase('/technical-details/reference'), to: withBase('/reference/') } ); return redirects; @@ -264,12 +266,19 @@ export function createRedirects(existingPath: string, basePath: string = ''): st } } + // Old Technical Details -> Reference paths + if (existingPath.startsWith(`${basePath}/reference/`)) { + const subpath = existingPath.replace(`${basePath}/reference/`, ''); + if (subpath) { + redirects.push(`${basePath}/technical-details/reference/${subpath}`); + } + } + // Don't create wildcard redirects for these as they're all explicitly defined: // - /developers/security/* (all subpaths are explicit) // - /deployments/harper-cli (explicit) // - /developers/sql-guide/* (has explicit redirect) // - /developers/operations-api/* (has explicit redirects) - // - /reference/* (has explicit redirect) return redirects.length > 0 ? redirects : undefined; }