S
S
Sergey Arsentiev2021-06-29 13:28:58
htaccess
Sergey Arsentiev, 2021-06-29 13:28:58

How to make a redirect work in HTACCESS from a specific url?

Hello, tell me how to make a redirect with the URL /2-glavnaya?q=%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D0 %B8-%D0%94%D0%B5%D1%82%D1%81%D0%BA%D0%B8%D0%B5+%D0%BA%D1%80%D0%BE%D0%B2%D0% B0%D1%82%D0%BA%D0%B8 to the main page for example.
This is Opencart.
Tried different ways, nothing works.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-06-29
@dodo512

At the beginning of .htaccess add

RewriteCond %{QUERY_STRING} (?:^|&)q=%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D0%B8-%D0%94%D0%B5%D1%82%D1%81%D0%BA%D0%B8%D0%B5\+%D0%BA%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D0%BA%D0%B8(?:$|&)
RewriteRule ^2-glavnaya$ /? [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question