I want to give references like / catalog / xxx -> /catalog/xxx.html
I write a location:
location /catalog/ { rewrite ^/catalog/(.*)$ /catalog/$1.html permanent; } But in the end, when referring to the site.ru/catalog/ section, I get to site.ru/catalog/.html
location ~ ^/catalog/(.+)$ { return http://site.ru/catalog/$1.html; }location ~ ^/catalog/(.+)$ { return http://site.ru/catalog/$1.html; }better probably so. The permanent is thereturn 301 URL;- Deadooshkalocation ~ ^/catalog/(.+?)(?!\.html)$ { return http://site.ru/catalog/$1.html; }location ~ ^/catalog/(.+?)(?!\.html)$ { return http://site.ru/catalog/$1.html; }. if there are no dots before .html, thenlocation ~ ^/catalog/([^\.]+)$easierlocation ~ ^/catalog/([^\.]+)$- Deadooshka^/catalog/(.+?)/?(?!\.html)$or^/catalog/([^\.]+?)/?$^/catalog/(.+?)/?(?!\.html)$- Deadooshka