diff --git a/src/features/redirects/redirects.json b/src/features/redirects/redirects.json index 5ccb70c30..2fb227517 100644 --- a/src/features/redirects/redirects.json +++ b/src/features/redirects/redirects.json @@ -10,11 +10,13 @@ "destination": "community", "statusCode": 301 }, + { "source": "docs/any-api/api-reference", "destination": "any-api/api-reference", "statusCode": 301 }, + { "source": "developers/developer-quickstart", "destination": "/developers", @@ -44,6 +46,159 @@ "source": "getting-started/overview", "destination": "/developers", "statusCode": 301 + }, + + { + "source": "sdk", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/sdk-faq", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/technical-stack", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/technical-stack/configuration", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/technical-stack/services", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/technical-stack/contracts", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/technical-stack/proof-generation", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/guides/devnet-deployment", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/guides/digital-ocean-alt-gas-token", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/guides/aws-deployment", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/guides/customizing-sdk-components", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/operation/contracts-verification", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/operation/gas-and-fees", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/operation/monitoring", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/operation/upgrades", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/operation/troubleshooting", + "destination": "/developers", + "statusCode": 301 + }, + { + "source": "sdk/operation/security-and-recovery", + "destination": "/developers", + "statusCode": 301 + }, + + { + "source": "learn", + "destination": "/technology", + "statusCode": 301 + }, + { + "source": "learn/the-scalability-problem", + "destination": "/technology", + "statusCode": 301 + }, + { + "source": "learn/intro-to-rollups", + "destination": "/technology", + "statusCode": 301 + }, + { + "source": "learn/zero-knowledge/introduction-to-zero-knowledge", + "destination": "/technology", + "statusCode": 301 + }, + { + "source": "learn/zero-knowledge/polynomial-commitment-schemes", + "destination": "/technology", + "statusCode": 301 + }, + { + "source": "learn/zero-knowledge/kzg-commitment-scheme", + "destination": "/technology", + "statusCode": 301 + }, + { + "source": "learn/zero-knowledge/additional-zk-learning-resources", + "destination": "/technology", + "statusCode": 301 + }, + + { + "source": "user-guide", + "destination": "/community", + "statusCode": 301 + }, + { + "source": "user-guide/setup", + "destination": "/community", + "statusCode": 301 + }, + { + "source": "user-guide/faucet", + "destination": "/community", + "statusCode": 301 + }, + { + "source": "user-guide/bridge", + "destination": "/community", + "statusCode": 301 + }, + { + "source": "user-guide/transfer-tokens", + "destination": "/community", + "statusCode": 301 + }, + { + "source": "user-guide/common-errors", + "destination": "/community", + "statusCode": 301 } ] } diff --git a/src/middleware.ts b/src/middleware.ts deleted file mode 100644 index a4a761822..000000000 --- a/src/middleware.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { MiddlewareHandler } from "astro" - -export const onRequest: MiddlewareHandler = (context, next) => { - const url = new URL(context.request.url) - const pathname = url.pathname - - if ( - pathname.startsWith("/sdk") || - pathname.startsWith("/en/sdk") || - pathname.startsWith("/es/sdk") || - pathname.startsWith("/tr/sdk") || - pathname.startsWith("/zh/sdk") - ) { - return context.redirect("/developers", 301) - } - - if ( - pathname.startsWith("/learn") || - pathname.startsWith("/en/learn") || - pathname.startsWith("/es/learn") || - pathname.startsWith("/tr/learn") || - pathname.startsWith("/zh/learn") - ) { - return context.redirect("/technology", 301) - } - - if ( - pathname.startsWith("/user-guide") || - pathname.startsWith("/en/user-guide") || - pathname.startsWith("/es/user-guide") || - pathname.startsWith("/tr/user-guide") || - pathname.startsWith("/zh/user-guide") - ) { - return context.redirect("/community", 301) - } - - return next() -}