]> git.mxchange.org Git - friendica.git/commitdiff
Simple robots.txt for server 404 log
authorDenis Chenu <denis@sondages.pro>
Wed, 26 Apr 2017 13:39:35 +0000 (15:39 +0200)
committerDenis Chenu <denis@sondages.pro>
Wed, 26 Apr 2017 13:39:35 +0000 (15:39 +0200)
mod/robots_txt.php [new file with mode: 0644]

diff --git a/mod/robots_txt.php b/mod/robots_txt.php
new file mode 100644 (file)
index 0000000..450b854
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+/**
+ * return the default robots.txt
+ * @version 0.1.0
+ */
+
+/**
+ * Simple robots.txt
+ * @inheritdoc (?)
+ */
+function robots_txt_init(App $a) {
+
+    /** @var string[] globally disallowed url */
+    $allDisalloweds=array(
+        '/settings/',
+        '/admin/',
+        '/message/',
+    );
+
+    header("Content-Type: text/plain");
+    echo "User-agent: *\n";
+    echo "Disallow:\n";
+    echo "\n";
+    echo "User-agent: *\n";
+    foreach($allDisalloweds as $disallowed) {
+        echo "Disallow: {$disallowed}\n";
+    }
+    killme();
+}