Is your site multilingual and set-up to have variants? If you have set-up multiple languages then you can right-click the Home node and select "Culture and Hostnames" and then add your locale as part of the domain.
So if you wanted your URLs to start with /en/... then you'd add /en in the domain for the language English. Repeat for each language you wish to support.
Force include locale in url
I need to always redirect to page with locale in url
Ex:
I have a page with name "product1" I want to serve it for:
But!
If user navigate to
/products/product1
I wanna redirect him to
/{locale}/products/product1
where locale got from Accept-Lang header.What's best approach to get it done?
I think I need to serve all my pages on my site with this rule
Is your site multilingual and set-up to have variants? If you have set-up multiple languages then you can right-click the Home node and select "Culture and Hostnames" and then add your locale as part of the domain.
So if you wanted your URLs to start with
/en/...
then you'd add/en
in the domain for the language English. Repeat for each language you wish to support.See https://our.umbraco.com/Documentation/Fundamentals/Backoffice/Variants/
You can get the accept language from the Request.UserLanguages variable, if there are any,
Yeah, but if I will navigate to
/products/product1
without locale set, I will get 404, but It should be redirect to/en/products/product1
as exampleis working on a reply...