Reputation: 12627
On my apache server I want to block every request containing the string test.
e.g. https://example.com/test/index.php
This should be blocked via the .htaccess file, since the url contains test.
Can you please help me creating the regex statement?
Upvotes: 1
Views: 633
Reputation: 785146
You can just use a simple rule at top of your .htaccess like this:
RewriteEngine On
RewriteCond %{REQUEST_URI} /test/ [NC]
RewriteRule ^ - [F]
Upvotes: 3