S
S
Sergey2020-02-05 12:40:47
htaccess
Sergey, 2020-02-05 12:40:47

How to redirect all links of this kind?

Tell me how to make a redirect of this kind
//site.ru/?wordfence_lh=1&hid=B32A556F519D0207F45797596B7D5639

So that all links where /?wordfenc_lh are redirected to the 404.php file I

did this
RewriteCond %{REQUEST_URI} /?wordfence.* [NC]
RewriteRule . + /410.php [L,R=301]

Not working

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-02-05
@sergeiy_permyakov

If you need a 301 redirect.

RewriteCond %{QUERY_STRING} (?:^|&)wordfence_lh=
RewriteRule ^ /404.php? [R=301,L]

If you need an internal redirect.
ErrorDocument 404 /404.php

RewriteCond %{QUERY_STRING} (?:^|&)wordfence_lh=
RewriteRule ^ - [R=404,L]

Or
RewriteCond %{QUERY_STRING} (?:^|&)wordfence_lh=
RewriteRule ^ /404.php? [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question