QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.25k stars 59 forks source link

The url doesn't change when has dot. #253

Closed kindslayer closed 10 months ago

kindslayer commented 10 months ago

Describe the bug When url contains (.) the url doesn't change to locales.

i have this url: example.com/exam.ple

Normally, we should be redirected to the following address, but it is not done example.com/en/exam.ple

QuiiBz commented 10 months ago

Just curious, why do you have URLs with dots?

kindslayer commented 10 months ago

I have urls like this man: example.com/logo.svg example.com/robots.txt example.com/sitemap.xml example.com/slide1.png

These addresses will exist in every project. I think if we have a whitelist extentions or whitelist for mimetype this problem is gone. Tell me your opinion so that we can consider the changes and send a pull request

QuiiBz commented 10 months ago

These files should be in the public directory if possible - and if they need to be inside the app directory, you can exclude them from the middleware using the matcher config, as shown in the docs:

export const config = {
                                          // add any other file here
  matcher: ['/((?!api|static|.*\\..*|_next|favicon.ico|robots.txt).*)']
}