R
R
raxer2020-08-28 11:11:40
Nginx
raxer, 2020-08-28 11:11:40

How to change URL in nginx?

On the site, the page is located at:
https://domain.ru/catalog/good.html - URL of the detailed product page
https://domain.ru/catalog/name/ - URL of the catalog page
I need the user and the search engine instead of catalog saw the product (i.e. https://domain.ru/product/good.htm .
In this case, the catalog page should open at the link https://domain.ru/catalog/name/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Somewhere Intech, 2020-08-28
@john36allTa

location /product {
  rewrite ^/product/(.*) /catalog/$1 break;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question