How to redirect all links containing a certain string using htaccess?

In particular, the template links to the rightслучайная line

examples of good links

All other links should be otherdirected one other page, for example
October 8th 19 at 02:41
2 answers
October 8th 19 at 02:43
Surely we can do better, but it seems to work:
RewriteEngine On<br> RewriteCond %{REQUEST_URI} !^/bad\.php<br / > RewriteCond %{REQUEST_URI} !^/mypage\.php [OR]<br> RewriteCond %{QUERY_STRING} !^j=[^&]+$<br> RewriteRule .* /bad.php? [R=301,L]<br>
I do not work, good links also redirects - Eulalia22 commented on October 8th 19 at 02:46
October 8th 19 at 02:45
and it looks like a wrong link an example?
For the correct links should be some rule for example 3 the first letter then 1 number 3 letters and numbers, or define the wrong links, it will be impossible

Find more questions by tags htaccess