C
C
creptor2022-01-24 18:35:59
htaccess
creptor, 2022-01-24 18:35:59

How to make a redirect in .htaccess RedirectMatch?

You need to make a redirect from
/(.*)/cat_1/ to /cat_1/
But so that the blog does not get into the brackets.

In fact, a redirect from any combination of characters except /blog/cat_1/
/moscow/cat_1/ - redirect
/spb/cat_1/ - redirect
/orel/cat_1/ - redirect
/blog/cat_1/ - no redirect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2022-01-24
@creptor

RedirectMatch 301 ^/(?!blog/).*(/cat_1/) $1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question