From f369d644fbf5261ab785527a55813770af8c6aac Mon Sep 17 00:00:00 2001 From: Jarvis Prime Date: Mon, 23 Mar 2026 16:58:20 +0000 Subject: [PATCH] go.componentowl.com redirect Worker --- src/index.js | 14 ++++++++++++++ wrangler.toml | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 src/index.js create mode 100644 wrangler.toml diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..0bb9556 --- /dev/null +++ b/src/index.js @@ -0,0 +1,14 @@ +const REDIRECTS = { + 'blv-tech-comparison': 'http://www.componentowl.com/quick-start-guide/better-listview/data/chapter-appendix-matrix.html', +}; +const HOME = 'https://www.componentowl.com'; + +export default { + async fetch(request) { + const url = new URL(request.url); + const path = url.pathname.replace(/^\//, '').replace(/\/$/, ''); + const dest = REDIRECTS[path] || HOME; + const qs = url.search || ''; + return Response.redirect(dest + qs, 302); + } +}; diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..200a51d --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,7 @@ +name = "cowl-redirects" +main = "src/index.js" +compatibility_date = "2024-01-01" +workers_dev = true +routes = [ + { pattern = "go.componentowl.com/*", zone_name = "componentowl.com" } +]