I see some traffic burst on my apache with all invalid URLs but with a specific pattern. Below are the some URLs
www.example.com/?1gx2A1WV=Ji7iMHhDsDOHvesb8
www.example.com/?LTn28PGXpg=VQTNObTmrhyF7Pjs2VoX
So basically I want to block this pattern in apache. anything that has “?” after www.example.com/ should be blocked.
Can someone please help me creating RewriteRule in apache for this.
Thanks in advance.
2
Answers
This should help. RewriteCond matches the pattern you have mentioned for request uri. Rewrite Rule sends back 403 as HTTP Response. Your use of Location may vary based on your apache configuration.
REQUEST_URI does not contain query string.
Try matching your rule against QUERY_STRING