How to redirect QueryString URLs (spammy) to 404 error page using .htaccess
-
Hi,
One of My website hacked and hacked added 1000s of spam pages with URLs like
https://www.example.com/?viewtopic.php&eqkqw=3&ddsdl=590&qzhto=16
I want to redirect to those URLs to 404 so that… the response code should be 404 not 200 with redirect to 404.php
I tried following… code in .htaccess
————
RewriteEngine On
RewriteCond %{QUERY_STRING} ^viewtopic.php(.*)$
RewriteRule ^/?$ – [L,R=404]
————
It is working well if I remove Wrodpress from Hosting… and put .htaccess at root.But NOT working with wordpress .htaccess
I’ve already tried inside, outside… every possibility
# BEGIN WordPress
<IfModule mod_rewrite.c>
…..
…..
</IfModule>
# END WordPressCan any body provide proper Code to resolve this issue?
- The topic ‘How to redirect QueryString URLs (spammy) to 404 error page using .htaccess’ is closed to new replies.