Answer the question
In order to leave comments, you need to log in
How to force nginx to redirect without inserting a slash before the extension?
There is a rule in which nginx redirects all requests of the form site.ru/catalog/aloha to site.ru/catalog/aloha.html
location ~ ^/catalog/([^\.]+)$ { return http://site.ru/catalog/$1.html; }
Answer the question
In order to leave comments, you need to log in
location ~ ^/catalog/([^\.\/]+)/?$ {
return http://site.ru/catalog/$1.html;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question