Created
February 17, 2026 16:28
-
-
Save ewg118/fc8b0cb305a6d733f95b6792e0ced50a to your computer and use it in GitHub Desktop.
Apache config for blocking old user agents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetEnvIf User-Agent "Mozilla/[1-3].*" badbot | |
| SetEnvIf User-Agent "Ubuntu/1*" badbot | |
| SetEnvIf User-Agent "Android [1-4]\." badbot | |
| SetEnvIf User-Agent "iPhone OS [0-6]_" badbot | |
| SetEnvIf User-Agent "Mac OS X 10_[0-6]_" badbot | |
| SetEnvIf User-Agent "Windows NT [1-6]\..*" badbot | |
| SetEnvIf User-Agent "Safari/[1-4][0-9][0-9]\..*" badbot | |
| SetEnvIf User-Agent "Chrome/[0-6][0-9]\." badbot | |
| SetEnvIf User-Agent "Windows 9.*" badbot | |
| SetEnvIf User-Agent "Windows CE.*" badbot | |
| RewriteCond %{ENV:badbot} ^1$ | |
| RewriteRule ^ - [F] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment