File size: 346 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
// Ensure that https://github.com/vercel/next.js/issues/56286 is fixed.
import { NextResponse } from 'next/server'

export async function middleware(req) {
  if (req.nextUrl.pathname.includes('rewrite-to-static-first')) {
    req.nextUrl.pathname = '/static/first'
    return NextResponse.rewrite(req.nextUrl)
  }

  return NextResponse.next()
}