@@ -25,6 +25,52 @@ const zlan = `./_remotes/zlan`;
2525const isVercel = process . env . IS_VERCEL === 'true' ;
2626const docsBase = isVercel ? '/' : '/docs/' ;
2727
28+ // Redirect paths are relative to baseUrl. isVercel changes the prefix needed.
29+ // Production (baseUrl='/docs/'): /zrok/... | Vercel (baseUrl='/'): /docs/zrok/...
30+ const zrokBase = isVercel ? '/docs/zrok' : '/zrok' ;
31+ const zrokRedirects = [
32+ // getting-started → get-started
33+ { to : '/get-started/' , from : [ '/getting-started' ] } ,
34+ // category/guides → category/how-to-guides
35+ { to : '/category/how-to-guides' , from : [ '/category/guides' ] } ,
36+ // guides/* → how-tos/*
37+ { to : '/how-tos/agent/' , from : [ '/guides/agent/' ] } ,
38+ { to : '/how-tos/agent/http-healthcheck' , from : [ '/guides/agent/http-healthcheck' ] } ,
39+ { to : '/how-tos/agent/linux-service' , from : [ '/guides/agent/linux-service' ] } ,
40+ { to : '/how-tos/agent/remoting' , from : [ '/guides/agent/remoting' ] } ,
41+ { to : '/how-tos/agent/windows-service/' , from : [ '/guides/agent/windows-service/' ] } ,
42+ { to : '/how-tos/docker-share/' , from : [ '/guides/docker-share/' ] } ,
43+ { to : '/how-tos/docker-share/private-share' , from : [ '/guides/docker-share/docker_private_share_guide' ] } ,
44+ { to : '/how-tos/docker-share/public-share' , from : [ '/guides/docker-share/docker_public_share_guide' ] } ,
45+ { to : '/how-tos/drives' , from : [ '/guides/drives' ] } ,
46+ { to : '/how-tos/frontdoor' , from : [ '/guides/frontdoor' ] } ,
47+ { to : '/how-tos/install/' , from : [ '/guides/install/' ] } ,
48+ { to : '/how-tos/install/linux' , from : [ '/guides/install/linux' ] } ,
49+ { to : '/how-tos/install/macos' , from : [ '/guides/install/macos' ] } ,
50+ { to : '/how-tos/install/windows' , from : [ '/guides/install/windows' ] } ,
51+ { to : '/how-tos/permission-modes' , from : [ '/guides/permission-modes' ] } ,
52+ { to : '/how-tos/v2-migration-guide' , from : [ '/guides/v2-migration-guide' ] } ,
53+ { to : '/how-tos/vpn' , from : [ '/guides/vpn' ] } ,
54+ // guides/self-hosting/* → self-hosting/*
55+ { to : '/self-hosting/docker' , from : [ '/guides/self-hosting/docker' ] } ,
56+ { to : '/self-hosting/dynamic-proxy' , from : [ '/guides/self-hosting/dynamicProxy' ] } ,
57+ { to : '/self-hosting/error-pages' , from : [ '/guides/self-hosting/error-pages' ] } ,
58+ { to : '/self-hosting/instance-configuration' , from : [ '/guides/self-hosting/instance-configuration' ] } ,
59+ { to : '/self-hosting/interstitial-page' , from : [ '/guides/self-hosting/interstitial-page' ] } ,
60+ { to : '/self-hosting/kubernetes' , from : [ '/guides/self-hosting/kubernetes' ] } ,
61+ { to : '/self-hosting/linux/' , from : [ '/guides/self-hosting/self_hosting_guide' , '/guides/self-hosting/linux' ] } ,
62+ { to : '/self-hosting/linux/nginx' , from : [ '/guides/self-hosting/nginx_tls_guide/' , '/guides/self-hosting/linux/nginx' ] } ,
63+ { to : '/self-hosting/metrics-and-limits/configuring-limits' , from : [ '/guides/metrics-and-limits/configuring-limits' , '/guides/self-hosting/metrics-and-limits/configuring-limits' ] } ,
64+ { to : '/self-hosting/metrics-and-limits/configuring-metrics' , from : [ '/guides/metrics-and-limits/configuring-metrics' , '/guides/self-hosting/metrics-and-limits/configuring-metrics' ] } ,
65+ { to : '/self-hosting/oauth/configuring-oauth' , from : [ '/guides/self-hosting/oauth/configuring-oauth' ] } ,
66+ { to : '/self-hosting/oauth/integrations/github' , from : [ '/guides/self-hosting/oauth/integrations/github' ] } ,
67+ { to : '/self-hosting/oauth/integrations/google' , from : [ '/guides/self-hosting/oauth/integrations/google' ] } ,
68+ { to : '/self-hosting/oauth/integrations/oidc' , from : [ '/guides/self-hosting/oauth/integrations/oidc' ] } ,
69+ { to : '/self-hosting/organizations' , from : [ '/guides/self-hosting/organizations' ] } ,
70+ { to : '/self-hosting/personalized-frontend' , from : [ '/guides/self-hosting/personalized-frontend' ] } ,
71+ { to : '/self-hosting/self-service-invite' , from : [ '/guides/self-hosting/self-service-invite' ] } ,
72+ ] . map ( ( { to, from } ) => ( { to : `${ zrokBase } ${ to } ` , from : from . map ( f => `${ zrokBase } ${ f } ` ) } ) ) ;
73+
2874// On Vercel previews, the baseUrl needs to be '/', routes need a 'docs/' prefix to match hardcoded /docs/ links in remote content.
2975// On default non-Vercel-preview builds baseUrl is '/docs/'
3076function routeBase ( name : string ) {
@@ -351,6 +397,13 @@ const config: Config = {
351397 [ pluginHotjar , { } ] ,
352398 [ '@docusaurus/plugin-google-tag-manager' , { id : `openziti-gtm` , containerId : cfg . google . tag } ] ,
353399 build ( BUILD_FLAGS . SELFHOSTED ) && onpremRedirects ( routeBase ( 'selfhosted' ) ) ,
400+ // Single plugin-client-redirects instance (only one instance allowed).
401+ // Add other products' redirect arrays here as they are needed.
402+ [ '@docusaurus/plugin-client-redirects' , {
403+ redirects : [
404+ ...( build ( BUILD_FLAGS . ZROK ) ? zrokRedirects : [ ] ) ,
405+ ] ,
406+ } ] ,
354407 ] . filter ( Boolean ) ,
355408 themeConfig : {
356409 docs : {
0 commit comments