---
title: Middleware
description: Next.js proxy for implementing i18n routing
---

## Setup

Redirects users to appropriate locale, it can be customized from `i18n.ts` config file.

<include cwd meta='title="proxy.ts"'>
  ../../examples/i18n/proxy.ts
</include>

> When `hideLocale` is enabled, it uses `NextResponse.rewrite` to hide locale prefixes.
