We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3688b8a commit b6474e1Copy full SHA for b6474e1
src/middleware.ts
@@ -43,10 +43,12 @@ export default function middleware(
43
})(request, event);
44
}
45
46
- // get the path for the current request
+ // Extract the URL pathname
47
const path = request.nextUrl.pathname;
48
49
- // ? check some files name for serve, what ever you want
+ // Allow direct access to sitemap.xml and robots.txt without i18n middleware processing
50
+ // This ensures these files are properly served for SEO purposes
51
+ // Related to GitHub issue: https://github.com/ixartz/Next-js-Boilerplate/issues/356
52
if (path === '/sitemap.xml' || path === '/robots.txt') {
53
return NextResponse.next();
54
0 commit comments