in my middleware I want to setup a matcher that will match all paths except for: /api routes, /_next (Next.js internals), /_static (inside /public), /images (inside /public) and all root files inside /public
however, when I visit my app from the root path like: some-url.com
it does not go into the middleware, because the matcher does not match it
here is my config:
export const config = {
matcher: [
/*
* Match all paths except for:
* 1. /api routes
* 2. /_next (Next.js internals)
* 3. /_static (inside /public)
* 4. /images (inside /public)
* 5. all root files inside /public (e.g. /favicon.ico)
*/
"/((?!api/|_next/|_static/|images/|[\\w-]+\\.\\w+).*)"
]
};
I want it to run the middleware when I visit my site from rool path like some-url.com, but with this config unfortonatly it does not
what is wrong here?