Create bots.php
authorPatrick McGuire <insidenothing@gmail.com>
Fri, 3 Jul 2020 15:12:04 +0000 (11:12 -0400)
committerGitHub <noreply@github.com>
Fri, 3 Jul 2020 15:12:04 +0000 (11:12 -0400)
bots.php [new file with mode: 0644]

diff --git a/bots.php b/bots.php
new file mode 100644 (file)
index 0000000..4ca1896
--- /dev/null
+++ b/bots.php
@@ -0,0 +1,16 @@
+<?PHP
+// die on bot match
+$bot = $_SERVER['HTTP_USER_AGENT'];
+$pos = strpos($bot, 'SemrushBot');
+if ($pos !== false) {
+    die('bad robot');
+} 
+$pos = strpos($bot, 'AhrefsBot');
+if ($pos !== false) {
+    die('bad robot');
+} 
+$pos = strpos($bot, 'Slackbot');
+if ($pos !== false) {
+    die('bad robot');
+} 
+?>