I
I
Irina2018-04-05 14:06:36
Nginx
Irina, 2018-04-05 14:06:36

How to write a redirect to nginx - cut a substring?

Links like
/catalog/f-clear/
/catalog/obuv/f-clear/name/
/catalog/obuv/f-clear/
We need to write a rule so that /f-clear is always removed from the link

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-04-05
@iitovka

Return a permanent redirect (301) to a link without /f-clear
https://nginx.ru/ru/docs/http/ngx_http_rewrite_mod... And as a [bad] option, you can remove this /f-clear https when serving content ://nginx.ru/ru/docs/http/ngx_http_sub_module....

sub_filter_once off;
sub_filter_types text/html;
sub_filter "/f-clear" "/";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question