Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/en-US/next/guides/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Automatic language detection and URL routing based on user preferen
Middleware automatically detects user language preferences and redirects them to the appropriate localized version of your site.
It uses browser settings, geolocation, and user preferences to serve the right language before any content loads.

<Callout>
<Callout type="info">
**File location:** Place `proxy.ts` in your project root, at the same level as your `app/` directory - not inside it. `proxy.ts` (Next.js 16+) or `middleware.ts` (Next.js 15 and below)
</Callout>

Expand Down Expand Up @@ -134,13 +134,13 @@ export const config = {
};
```

<Callout>
Test your middleware configuration thoroughly - incorrect matchers can cause infinite redirects or break static assets.
<Callout type="warn">
**Caution:** Test your middleware configuration thoroughly incorrect matchers can cause infinite redirects or break static assets.
</Callout>

## Next steps

<Callout>
<Callout type="info">
**See it in action:** The [static site generation example app](https://github.com/gt-examples/static-site-generation) includes a full middleware setup with locale routing — [live preview](https://static-site-generation.generaltranslation.dev).
</Callout>

Expand Down
Loading