Skip to content

Commit 8374f85

Browse files
committed
fix hub to plus forwarding
1 parent 60cd328 commit 8374f85

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docs/website/worker.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ const REDIRECTS = [
6666

6767
// dlt+ redirect
6868
{
69-
from: "/docs/plus/",
70-
to: "/docs/hub/"
69+
from: "/docs/hub",
70+
to: "/docs/hub/intro"
7171
},
72+
7273
]
7374

7475
const ROUTE_404 = "/docs/404";
@@ -78,11 +79,17 @@ const handler = {
7879

7980
const url = new URL(request.url);
8081

82+
// forward plus requests to hub
83+
if (url.pathname.includes("/plus")) {
84+
url.pathname = url.pathname.replace("/plus", "/hub");
85+
return Response.redirect(url.toString(), 301);
86+
}
87+
8188
// handle redirects
8289
for (const redirect of REDIRECTS) {
8390
if (url.pathname === redirect.from) {
8491
url.pathname = redirect.to;
85-
return Response.redirect(url.toString(), redirect.code || 301);
92+
return Response.redirect(url.toString(), 301);
8693
}
8794
}
8895

0 commit comments

Comments
 (0)