tsogtgerel.ts
tsogtgerel.ts

Reputation: 975

latin and non latin multi language url with next.js

We have to build react web with next.js and problem with multilanguage url. Our goal is same content for diffrent language have diffrend url slug. For example www.tld.com/blog for blog page in english post list, www.tld.com/блог for blog page in mongolian blog post.

Upvotes: 2

Views: 699

Answers (1)

Oded Ben Dov
Oded Ben Dov

Reputation: 10397

You can use next.js rewrites to transform a subpath like /blog vs /блог to url parameters such as ?lang=en for example, or a different page possible.

Also - just figured this out - if you want static pages with non-latin characters, you can use the url escaped notation in file names and redirects, so a file named %D7%A9%D7%9C%D7%95%D7%9D.js would route to a /שלום url

Hope this helps!

Upvotes: 1

Related Questions