Skip to content

Commit 4308fe6

Browse files
committed
conditional root redirect to the base path
1 parent 50b55c6 commit 4308fe6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

redirects.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ function generateDocsRedirects(basePath: string): RedirectRule[] {
2020
return basePath === '/' ? path : `${basePath}${path}`;
2121
};
2222

23-
return [
23+
const redirects: RedirectRule[] = [];
24+
25+
// Only add root redirect if docs are not at root
26+
if (basePath !== '/') {
27+
redirects.push({
28+
from: '/',
29+
to: basePath,
30+
});
31+
}
32+
33+
redirects.push(
2434
// Operations API
2535
{
2636
from: withBase('/developers/operations-api/utilities'),
@@ -146,7 +156,9 @@ function generateDocsRedirects(basePath: string): RedirectRule[] {
146156

147157
// File rename redirect
148158
{ from: withBase('/administration/logging/logging'), to: withBase('/administration/logging/standard-logging') },
149-
];
159+
);
160+
161+
return redirects;
150162
}
151163

152164
// Combine all redirects

0 commit comments

Comments
 (0)