Skip to content

Commit 2bb0392

Browse files
committed
Middleware is not executed on github pages
1 parent ccf13c6 commit 2bb0392

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const onRequest: MiddlewareHandler = async (context, next) => {
88

99
if (url.pathname.includes('wiki/') && !url.pathname.includes('.html')) {
1010
const redirectUrl = `${url.pathname.toLocaleLowerCase()}.html`;
11-
return context.rewrite(new Request(new URL(redirectUrl, url.origin)));
11+
return next(redirectUrl);
1212
}
1313

1414
return next();

0 commit comments

Comments
 (0)