my request…
http://localhost:3000/docs/시작하기
nextjs
GET /docs/%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0 200 in 97ms
Is there a way to configure Korean URL addresses to be routed in nextjs?
I tried configuring the middleware… but ERR_TOO_MANY_REDIRECTS ocured, somebody help me!!
2
Answers
app > docs > [category] > [mdx] > page.tsx
You can use Path Params to get the Korean content and then decode it using the
decodeURIComponent
method.How to create this dynamic param:
Access dynamic segments using
useRouter().query.slug
. Example route:/docs/[KoreanInput].js
where{ KoreanInput: '%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0' };
decodeURIComponent(KoreanInput)
, it will return actual Korean Content.Or
next.config.js
filei18n
and then define routes like below: