Answer the question
In order to leave comments, you need to log in
How to do rewrite for multilingual subdomains?
Colleagues, I welcome you.
The task is to put a multilingual Django web application on subdomains, sort of like for more efficient indexing by search engines.
You need to magically turn the site.com/en/* url into en.site.com/*
In the nginx config I write:
location /en {
rewrite ^ http://en.site.com$request_uri permanent;
}
Answer the question
In order to leave comments, you need to log in
In general, yes, it turned out to be the easiest way to create subdomains and resolve them through the middleware + redirect from the main domain after determining the language translation.get_language_from_request (request)
Maybe this will help: https://stackoverflow.com/questions/9923178/how-do...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question