Good Morning! I've been trying for hours how to make redirect page in middleware. I read the documentation and I'm using NextResponse.redirect('/about') and i get a message that: "Error: URLs is malformed. Please use only absolute URLs -"
If I enter the Absolute URL as: http://localhost:3000/about the browser keeps executing the request several times as shown in the image below.
I try this solution in Middleware Relative URLs, but the error persists.
Does anyone have any solution? Thanks.
Here is my code in _middleware.ts:
import { NextResponse } from 'next/server';
import type { NextFetchEvent, NextRequest } from 'next/server';
export function middleware(request: NextRequest, ev: NextFetchEvent) {
return NextResponse.redirect('/about')
}
The folder and the files localization:


