Can't formulate a rule for the redirect — how?

Good day!
Problem: all files of the form
site.ru/cat1/cat2/file.html

to otherdirected in:

site.ru/cat1/cat2/cat3/file.html

Line

RewriteRule ^cat1\cat2(.*)$ /cat1/cat2/cat3/$1 [R=301] does not picks up
March 23rd 20 at 18:57
1 answer
March 23rd 20 at 18:59
Solution
RewriteRule ^(cat1/cat2)/([^/]+\.html)$ /$1/cat3/$2 [R=301,L]
No picks :( - Name.Smith commented on March 23rd 20 at 19:02
@Name.Smith, a redirect needs to stand out above the rest RewriteRule. - Carmelo.OReill commented on March 23rd 20 at 19:05
Worked. I don't know how to place above the rest RewriteRule a dozen of these, but I'll try. Thank you. - Name.Smith commented on March 23rd 20 at 19:08
@Name.Smith, well, first put the rules with [R=301,L], and then the other with [L] - Carmelo.OReill commented on March 23rd 20 at 19:11

Find more questions by tags htaccess