A
A
Alex Kheben2011-10-02 17:02:43
htaccess
Alex Kheben, 2011-10-02 17:02:43

.htaccess RedirectMatch looping?

How to make a redirect from a link like myserv/cat1/tag1/af_3fffwfccfeg to myserv/cat1/tag1/ so that the condition doesn't cycle.
Any characters can be in the destination directory.
Those. you need to make the condition work only if there is something else after /cat1/tag1/, and if there is nothing, then the condition should not work.
I tried this:
RedirectMatch 301 /cat1/tag1/[\S*] myserv/digital/igromania/ I
also tried this regexr.com?2ur8c
It doesn't seem to highlight the second line, but when I apply this rule, I get a cyclic redirect.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Chernyshev, 2011-10-02
@zBit

RedirectMatch /cat1/tag1/([\S]+)$ site.ru/cat1/tag1/

L
loingrim, 2011-10-02
@loingrim

I suspect that it is not [\S*], but [\S+], because '*' is 0 or more, and you need 1 or more, and this is '+'.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question