I would like to add en-us
language code on URL. The expectation is as follows.
When a user hits on http://example.com/, page should redirect users to http://example.com/en-us/ Note: I have achieved this with the following code.
location = / {
rewrite ^ /en-us/ redirect;
}
How to redirect customers to following scenarios
- http://example.com/contact, should redirect to http://example.com/en-us/contact
- http://example.com/en-us/, it shouldn't append extra en-us in url.
- http://example.com/en-in/, it shouldn't append en-us in url.
Simply, what i want to achieve is if there is no en-us
in url, then we should add en-us in XX-XX place. http://example.com/XX-XX/contact