diff --git a/public/__redirects b/public/__redirects index cac8a08a20e7d37..881f7070b83e588 100644 --- a/public/__redirects +++ b/public/__redirects @@ -712,9 +712,6 @@ /fundamentals/setup/account/customize-account/communication-preference/ /fundamentals/account/customize-account/ 301 /fundamentals/setup/account/customize-account/language-preference/ /fundamentals/account/customize-account/ 301 /fundamentals/setup/ /fundamentals/account/ 301 -/fundamentals/setup/account/* /fundamentals/account/:splat 301 -/fundamentals/setup/manage-domains/* /fundamentals//manage-domains/:splat 301 -/fundamentals/setup/manage-members/* /fundamentals/manage-members/:splat 301 # gateway /gateway/about/ /cloudflare-one/policies/gateway/ 301 @@ -828,6 +825,74 @@ /learning-paths/clientless-access/ /learning-paths/clientless-access/concepts/ 301 /learning-paths/application-security/default-traffic-security/security-level/ /learning-paths/application-security/default-traffic-security/browser-integrity/ 301 +## Get started with Cloudflare --> fundamentals +/learning-paths/get-started/concepts/ /fundamentals/ 301 +/learning-paths/get-started/concepts/what-is-cloudflare/ /fundamentals/ 301 +/learning-paths/get-started/concepts/how-cloudflare-works/ /fundamentals/concepts/how-cloudflare-works/ 301 +/learning-paths/get-started/concepts/traffic-flow-cloudflare/ /fundamentals/concepts/traffic-flow-cloudflare/ 301 +/learning-paths/get-started/concepts/cloudflare-ips/ /fundamentals/concepts/cloudflare-ip-addresses/ 301 +/learning-paths/get-started/account-setup/ /fundamentals/account/create-account/ 301 +/learning-paths/get-started/account-setup/create-account/ /fundamentals/account/create-account/ 301 +/learning-paths/get-started/account-setup/set-up-2fa/ /fundamentals/account/account-security/2fa/ 301 +/learning-paths/get-started/account-setup/customize-account/ /fundamentals/account/customize-account/account-name/ 301 +/learning-paths/get-started/account-setup/add-other-members/ /fundamentals/manage-members/ 301 +/learning-paths/get-started/account-setup/create-api-token/ /fundamentals/api/how-to/create-via-api/ 301 +/learning-paths/get-started/add-domain-to-cf/ /fundamentals/manage-domains/add-site/ 301 +/learning-paths/get-started/add-domain-to-cf/minimize-downtime/ /fundamentals/performance/minimize-downtime/ 301 +/learning-paths/get-started/add-domain-to-cf/allow-cloudflare-ips/ /fundamentals/concepts/cloudflare-ip-addresses/ 301 +/learning-paths/get-started/add-domain-to-cf/disable-dnssec/ /dns/dnssec/#disable-dnssec 301 +/learning-paths/get-started/add-domain-to-cf/add-site/ /fundamentals/manage-domains/add-site/ 301 +/learning-paths/get-started/add-domain-to-cf/update-nameservers/ /dns/zone-setups/full-setup/setup/#update-your-nameservers 301 +/learning-paths/get-started/domain-resolution/ /fundamentals/manage-domains/ 301 +/learning-paths/get-started/domain-resolution/review-dns-records/ /dns/zone-setups/full-setup/setup/#review-dns-records 301 +/learning-paths/get-started/domain-resolution/proxy-status/ /dns/proxy-status/ 301 +/learning-paths/get-started/domain-resolution/enable-dnssec/ /dns/dnssec/#enable-dnssec 301 +/learning-paths/get-started/domain-resolution/create-subdomain/ /fundamentals/manage-domains/manage-subdomains/ 301 +/learning-paths/get-started/domain-resolution/setup-email-records/ /dns/manage-dns-records/how-to/email-records/ 301 +/learning-paths/get-started/security/ /fundamentals/security/ 301 +/learning-paths/get-started/security/default-improvements/ /fundamentals/security/under-ddos-attack/ 301 +/learning-paths/get-started/security/ssl-tls/ /ssl/origin-configuration/ssl-modes/ 301 +/learning-paths/get-started/security/bot-fight-mode/ /bots/get-started/bot-fight-mode/ 301 +/learning-paths/get-started/security/secure-origin/ /fundamentals/security/protect-your-origin-server/ 301 +/learning-paths/get-started/security/security-center/ /security-center/ 301 +/learning-paths/get-started/security/add-on-products/ /products/?product-group=Application+security 301 +/learning-paths/get-started/security/security-settings/ /fundamentals/security/ 301 +/learning-paths/get-started/performance/ /fundamentals/performance/ 301 +/learning-paths/get-started/performance/default-improvements/ /fundamentals/performance/ 301 +/learning-paths/get-started/performance/optimize-caching/ /cache/get-started/ 301 +/learning-paths/get-started/performance/optimize-speed/ /speed/ 301 +/learning-paths/get-started/performance/web-analytics/ /web-analytics/ 301 +/learning-paths/get-started/performance/add-on-products/ /products/?product-group=Application+performance 301 + +## Get started free plan --> fundamentals +/learning-paths/get-started-free/onboarding/ /fundamentals/ 301 +/learning-paths/get-started-free/onboarding/add-and-activate/ /fundamentals/manage-domains/add-site/ 301 +/learning-paths/get-started-free/onboarding/proxy-dns-records/ /dns/proxy-status/ 301 +/learning-paths/get-started-free/onboarding/check-dns/ /dns/zone-setups/full-setup/troubleshooting/ 301 +/learning-paths/get-started-free/onboarding/check-ssl/ /ssl/troubleshooting/ 301 +/learning-paths/get-started-free/performance/ /fundamentals/performance/ 301 +/learning-paths/get-started-free/performance/default-improvements/ /fundamentals/performance/ 301 +/learning-paths/get-started-free/performance/optimize-caching/ /cache/get-started/ 301 +/learning-paths/get-started-free/performance/optimize-speed/ /speed/ 301 +/learning-paths/get-started-free/performance/web-analytics/ /web-analytics/ 301 +/learning-paths/get-started-free/performance/add-on-products/ /products/?product-group=Application+security 301 +/learning-paths/get-started-free/security/ /fundamentals/security/ 301 +/learning-paths/get-started-free/security/default-improvements/ /fundamentals/security/under-ddos-attack/ 301 +/learning-paths/get-started-free/security/ssl-tls/ /ssl/origin-configuration/ssl-modes/ 301 +/learning-paths/get-started-free/security/dnssec/ /dns/dnssec/#enable-dnssec 301 +/learning-paths/get-started-free/security/security-settings/ /fundamentals/security/ 301 +/learning-paths/get-started-free/security/bot-fight-mode/ /bots/get-started/bot-fight-mode/ 301 +/learning-paths/get-started-free/security/security-center/ /security-center/ 301 +/learning-paths/get-started-free/security/add-on-products/ /products/?product-group=Application+security 301 +/learning-paths/get-started-free/other-features/ /fundamentals/ 301 +/learning-paths/get-started-free/other-features/rules/ /rules/ 301 +/learning-paths/get-started-free/other-features/redirects/ /fundamentals/reference/redirects/ 301 +/learning-paths/get-started-free/other-features/analytics/ /analytics/account-and-zone-analytics/ 301 +/learning-paths/get-started-free/other-features/account-profile/ /fundamentals/account/ 301 +/learning-paths/get-started-free/other-features/email-routing/ /email-routing/ 301 +/learning-paths/get-started-free/other-features/resources/ /fundamentals/#additional-resources 301 +/learning-paths/get-started-free/other-features/product-lines/ /products/ 301 + # more redirects in the /dynamic/ section # load-balancing @@ -1717,9 +1782,8 @@ /workers-ai/markdown-conversion/ /workers-ai/features/markdown-conversion/ 301 # workflows - /workflows/reference/storage-options/ /workers/platform/storage-options/ 301 - +/workflows/tutorials/ /workflows/examples 301 # workers KV /kv/platform/environments/ /kv/reference/environments/ 301 @@ -2014,6 +2078,9 @@ /firewall/recipes/* /waf/custom-rules/use-cases/:splat 301 /web3/polygon-gateway/* /web3/ 301 /vectorize/configuration/* /vectorize/best-practices/:splat 301 +/fundamentals/setup/account/* /fundamentals/account/:splat 301 +/fundamentals/setup/manage-domains/* /fundamentals/manage-domains/:splat 301 +/fundamentals/setup/manage-members/* /fundamentals/manage-members/:splat 301 # Cloudflare One / Zero Trust /cloudflare-one/connections/connect-networks/install-and-setup/tunnel-guide/local/as-a-service/* /cloudflare-one/connections/connect-networks/configure-tunnels/local-management/as-a-service/:splat 301 @@ -2057,72 +2124,6 @@ /learning-paths/secure-internet-traffic/connect-devices/* /learning-paths/secure-internet-traffic/connect-devices-networks/:splat 301 ## Zero Trust Web Access --> Clientless Access /learning-paths/zero-trust-web-access/* /learning-paths/clientless-access/:splat 301 -## Get started with Cloudflare --> fundamentals -/learning-paths/get-started/concepts/ /fundamentals/ 301 -/learning-paths/get-started/concepts/what-is-cloudflare/ /fundamentals/ 301 -/learning-paths/get-started/concepts/how-cloudflare-works/ /fundamentals/concepts/how-cloudflare-works/ 301 -/learning-paths/get-started/concepts/traffic-flow-cloudflare/ /fundamentals/concepts/traffic-flow-cloudflare/ 301 -/learning-paths/get-started/concepts/cloudflare-ips/ /fundamentals/concepts/cloudflare-ip-addresses/ 301 -/learning-paths/get-started/account-setup/ /fundamentals/account/create-account/ 301 -/learning-paths/get-started/account-setup/create-account/ /fundamentals/account/create-account/ 301 -/learning-paths/get-started/account-setup/set-up-2fa/ /fundamentals/account/account-security/2fa/ 301 -/learning-paths/get-started/account-setup/customize-account/ /fundamentals/account/customize-account/account-name/ 301 -/learning-paths/get-started/account-setup/add-other-members/ /fundamentals/manage-members/ 301 -/learning-paths/get-started/account-setup/create-api-token/ /fundamentals/api/how-to/create-via-api/ 301 -/learning-paths/get-started/add-domain-to-cf/ /fundamentals/manage-domains/add-site/ 301 -/learning-paths/get-started/add-domain-to-cf/minimize-downtime/ /fundamentals/performance/minimize-downtime/ 301 -/learning-paths/get-started/add-domain-to-cf/allow-cloudflare-ips/ /fundamentals/concepts/cloudflare-ip-addresses/ 301 -/learning-paths/get-started/add-domain-to-cf/disable-dnssec/ /dns/dnssec/#disable-dnssec 301 -/learning-paths/get-started/add-domain-to-cf/add-site/ /fundamentals/manage-domains/add-site/ 301 -/learning-paths/get-started/add-domain-to-cf/update-nameservers/ /dns/zone-setups/full-setup/setup/#update-your-nameservers 301 -/learning-paths/get-started/domain-resolution/ /fundamentals/manage-domains/ 301 -/learning-paths/get-started/domain-resolution/review-dns-records/ /dns/zone-setups/full-setup/setup/#review-dns-records 301 -/learning-paths/get-started/domain-resolution/proxy-status/ /dns/proxy-status/ 301 -/learning-paths/get-started/domain-resolution/enable-dnssec/ /dns/dnssec/#enable-dnssec 301 -/learning-paths/get-started/domain-resolution/create-subdomain/ /fundamentals/manage-domains/manage-subdomains/ 301 -/learning-paths/get-started/domain-resolution/setup-email-records/ /dns/manage-dns-records/how-to/email-records/ 301 -/learning-paths/get-started/security/ /fundamentals/security/ 301 -/learning-paths/get-started/security/default-improvements/ /fundamentals/security/under-ddos-attack/ 301 -/learning-paths/get-started/security/ssl-tls/ /ssl/origin-configuration/ssl-modes/ 301 -/learning-paths/get-started/security/bot-fight-mode/ /bots/get-started/bot-fight-mode/ 301 -/learning-paths/get-started/security/secure-origin/ /fundamentals/security/protect-your-origin-server/ 301 -/learning-paths/get-started/security/security-center/ /security-center/ 301 -/learning-paths/get-started/security/add-on-products/ /products/?product-group=Application+security 301 -/learning-paths/get-started/security/security-settings/ /fundamentals/security/ 301 -/learning-paths/get-started/performance/ /fundamentals/performance/ 301 -/learning-paths/get-started/performance/default-improvements/ /fundamentals/performance/ 301 -/learning-paths/get-started/performance/optimize-caching/ /cache/get-started/ 301 -/learning-paths/get-started/performance/optimize-speed/ /speed/ 301 -/learning-paths/get-started/performance/web-analytics/ /web-analytics/ 301 -/learning-paths/get-started/performance/add-on-products/ /products/?product-group=Application+performance 301 -## Get started free plan --> fundamentals -/learning-paths/get-started-free/onboarding/ /fundamentals/ 301 -/learning-paths/get-started-free/onboarding/add-and-activate/ /fundamentals/manage-domains/add-site/ 301 -/learning-paths/get-started-free/onboarding/proxy-dns-records/ /dns/proxy-status/ 301 -/learning-paths/get-started-free/onboarding/check-dns/ /dns/zone-setups/full-setup/troubleshooting/ 301 -/learning-paths/get-started-free/onboarding/check-ssl/ /ssl/troubleshooting/ 301 -/learning-paths/get-started-free/performance/ /fundamentals/performance/ 301 -/learning-paths/get-started-free/performance/default-improvements/ /fundamentals/performance/ 301 -/learning-paths/get-started-free/performance/optimize-caching/ /cache/get-started/ 301 -/learning-paths/get-started-free/performance/optimize-speed/ /speed/ 301 -/learning-paths/get-started-free/performance/web-analytics/ /web-analytics/ 301 -/learning-paths/get-started-free/performance/add-on-products/ /products/?product-group=Application+security 301 -/learning-paths/get-started-free/security/ /fundamentals/security/ 301 -/learning-paths/get-started-free/security/default-improvements/ /fundamentals/security/under-ddos-attack/ 301 -/learning-paths/get-started-free/security/ssl-tls/ /ssl/origin-configuration/ssl-modes/ 301 -/learning-paths/get-started-free/security/dnssec/ /dns/dnssec/#enable-dnssec 301 -/learning-paths/get-started-free/security/security-settings/ /fundamentals/security/ 301 -/learning-paths/get-started-free/security/bot-fight-mode/ /bots/get-started/bot-fight-mode/ 301 -/learning-paths/get-started-free/security/security-center/ /security-center/ 301 -/learning-paths/get-started-free/security/add-on-products/ /products/?product-group=Application+security 301 -/learning-paths/get-started-free/other-features/ /fundamentals/ 301 -/learning-paths/get-started-free/other-features/rules/ /rules/ 301 -/learning-paths/get-started-free/other-features/redirects/ /fundamentals/reference/redirects/ 301 -/learning-paths/get-started-free/other-features/analytics/ /analytics/account-and-zone-analytics/ 301 -/learning-paths/get-started-free/other-features/account-profile/ /fundamentals/account/ 301 -/learning-paths/get-started-free/other-features/email-routing/ /email-routing/ 301 -/learning-paths/get-started-free/other-features/resources/ /fundamentals/#additional-resources 301 -/learning-paths/get-started-free/other-features/product-lines/ /products/ 301 # Cloudflare for SaaS /ssl/ssl-for-saas/common-tasks/* /cloudflare-for-platforms/cloudflare-for-saas/ 301 @@ -2166,9 +2167,6 @@ /workers-ai/demos/* /workers-ai/guides/demos-architectures/:splat 301 /workers-ai/tutorials/* /workers-ai/guides/tutorials/:splat 301 -# Workflows -/workflows/tutorials/ /workflows/examples 301 - # Others /logs/analytics-integrations/* /fundamentals/data-products/analytics-integrations/:splat 301 /fundamentals/notifications/* /notifications/:splat 301 diff --git a/worker/index.ts b/worker/index.ts index 35edf875b2008c5..619ffc2bc94c3bf 100644 --- a/worker/index.ts +++ b/worker/index.ts @@ -27,6 +27,22 @@ export default class extends WorkerEntrypoint { const res = await this.env.ASSETS.fetch(htmlUrl, request); if (res.status === 404) { + const redirect = await redirectsEvaluator( + new Request(htmlUrl, request), + this.env.ASSETS, + ); + + if (redirect) { + const location = redirect.headers.get("location"); + + return new Response(null, { + status: redirect.status, + headers: { + Location: location + "index.md", + }, + }); + } + return res; } diff --git a/worker/index.worker.test.ts b/worker/index.worker.test.ts index a73a1f860305ad8..5082e8664055074 100644 --- a/worker/index.worker.test.ts +++ b/worker/index.worker.test.ts @@ -65,6 +65,18 @@ describe("Cloudflare Docs", () => { expect(response.status).toBe(301); expect(response.headers.get("Location")).toBe("/workers/index.md"); }); + + it("redirects /fundamentals/setup/manage-domains/remove-domain/index.md to /fundamentals/manage-domains/remove-domain/index.md", async () => { + const request = new Request( + "http://fakehost/fundamentals/setup/manage-domains/remove-domain/index.md", + ); + const response = await SELF.fetch(request, { redirect: "manual" }); + + expect(response.status).toBe(301); + expect(response.headers.get("Location")).toBe( + "/fundamentals/manage-domains/remove-domain/index.md", + ); + }); }); describe("json endpoints", () => { diff --git a/wrangler.toml b/wrangler.toml index 5717264318f9e3b..cfaf0eeb0c2aaf6 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,7 +1,7 @@ #:schema ./node_modules/wrangler/config-schema.json name = "cloudflare-docs" account_id = "b54f07a6c269ecca2fa60f1ae4920c99" -compatibility_date = "2024-10-14" +compatibility_date = "2025-06-02" compatibility_flags = ["nodejs_compat"] main = "./worker/index.ts"