B
B
Buhta2019-05-17 15:24:29
htaccess
Buhta, 2019-05-17 15:24:29

How to make a redirect in htaccess url containing a part to the url with a parameter?

you need to figure out, but for me
there is a dark forest on the site urls like
www.domain.ru/catalog/any_category/filter/color-is-********/apply/
you need to redirect to
www.domain.ru/catalog /any_category/filter/color-is-********/apply/?view=offers
i.e. redirect only the url that contains "color-is-"
please tell me how to do it right.
any_category - can be different categories
and color-is-******** - can be different colors i.e. color-is-black color-is-white
Thank you very much!!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-05-17
@Buhta

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(catalog/[^/]+/filter/color-is-[^/]+/apply/)$ /$1?view=offers [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question