301 redirect when changing CMS?

Good afternoon.

Please tell me how to do a 301 redirect if the url contains /ttt/

The problem is that the URLs are different

Example:

url - site.ru/тут the numbers that change/ttt/here is the category name or product, is also changing constantly

We changed the cms and now need to set up 301 all pages, so as of now a lot of 404.

How to do a 301 to the url, which is /ttt/ were redirected to the main
June 14th 19 at 18:10
2 answers
June 14th 19 at 18:12
RewriteRule ^(.*)ttt(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
June 14th 19 at 18:14
does not help, 404 error

there's no way?
and what do you think should be there? - keara_Mosciski commented on June 14th 19 at 18:17
, 301 redirect to home - nikita.Stracke commented on June 14th 19 at 18:20
,
RewriteRule ^(.*)ttt(.*)$ <a href="http://%{HTTP_HOST}">http://%{HTTP_HOST}</a> [R=301,L]
- keara_Mosciski commented on June 14th 19 at 18:23
still 404
I may be doing wrong, here is my htaccess

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteRule ^(.*)ttt(.*)$ http://%{HTTP_HOST} [R=301,L]

# END WordPress - nikita.Stracke commented on June 14th 19 at 18:26
and such a path exists? I mean the folder is there? And Yes, you're definitely doing wrong, but I use Nginx, or rather I can say those who uses Apache2. - keara_Mosciski commented on June 14th 19 at 18:29

Find more questions by tags htaccess