mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-18 00:16:36 +00:00
redirect static files to a prefixed path
This commit is contained in:
10
src/middleware.js
Normal file
10
src/middleware.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export function middleware(req) {
|
||||
if (req.nextUrl.href.includes('/docs-static/_next/'))
|
||||
return NextResponse.rewrite(
|
||||
req.nextUrl.href.replace('/docs-static/_next/', '/_next/'),
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user