Next.js Discord

Discord Forum

Do I need to exclude resources in public directory from i18n Middleware URL check item by item?

Satin Angora posted this in #help-forum
Open in Discord
Satin AngoraOP
I'm following [i18n example from Next.js]( and I noticed that I need to explicitly ignore files in public directory.
I want to ask, do I need to exclude every single item? My static resources are located in path public/res/<resource category>. Can't I just ignore the /public/res folder?

How should I modify the matcher regex?
export const config = {
  matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)']

0 Replies