Answer the question
In order to leave comments, you need to log in
How to format a regular expression in nginx?
Hello
There was a need to remove the output of the root controller.
There is a website site.ru and when you open it, the catalog controller opens. The URL does not change. But if you open site.ru/catalog there will be the same main page.
You need to make a redirect when opening such a page and so that site.ru/catalog redirects to the main one, but site.ru/catalog/product/bb does not redirect to the main one.
I tried that, but it didn't work...
location /catalog {
return 301 http://site.net;
}
location /catalog/ {
return 301 http://site.net;
}
location ^/catalog {
return 301 http://site.net;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question