Hello,
I want to block some bad user agent strings for all my websites.
Instead of keeping the rewrite rules in each of my virtual host,
can I keep this code in httpd_config.conf so that it applies to all my websites?
If this is not correct, please suggest correct method.
Thanks
I want to block some bad user agent strings for all my websites.
Instead of keeping the rewrite rules in each of my virtual host,
can I keep this code in httpd_config.conf so that it applies to all my websites?
Code:
# Global rewrite rules
rewrite {
enable 1
autoLoadHtaccess 0
RewriteCond %{HTTP_USER_AGENT} seozoom [NC,OR]
RewriteCond %{HTTP_USER_AGENT} GPTBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Bytedance [NC]
RewriteRule .* - [F,L]
}
Thanks
Last edited: