M
M
mumur12019-06-03 21:50:53
htaccess
mumur1, 2019-06-03 21:50:53

I can’t formulate a rule for a redirect - how to do it right?

Good afternoon!
Task: redirect all files of the form
site.ru/cat1/cat2/file.html
to:
site.ru/cat1/cat2/cat3/file.html
Line
RewriteRule ^cat1\cat2(.*)$ /cat1/cat2/cat3/ $1 [R=301] does not pick up

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-06-03
@mumur1

RewriteRule ^(cat1/cat2)/([^/]+\.html)$ /$1/cat3/$2 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question