]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/RobotsTxt.php
Use the post language for the language detection / config for quality
[friendica.git] / src / Module / RobotsTxt.php
index 1fcf1269edf72de6acd90c982a1a957fb6c4462d..96a2451ad24625f9ce4f18302262a08160730e4a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,6 +22,7 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 
 /**
  * Return the default robots.txt
@@ -30,20 +31,35 @@ class RobotsTxt extends BaseModule
 {
        protected function rawContent(array $request = [])
        {
-               $allDisalloweds = [
+               $allDisallowed = [
                        '/settings/',
                        '/admin/',
                        '/message/',
                        '/search',
                        '/help',
                        '/proxy',
+                       '/photo',
+                       '/avatar',
                ];
 
                header('Content-Type: text/plain');
                echo 'User-agent: *' . PHP_EOL;
-               foreach ($allDisalloweds as $disallowed) {
+               foreach ($allDisallowed as $disallowed) {
                        echo 'Disallow: ' . $disallowed . PHP_EOL;
                }
-               exit();
+
+               echo PHP_EOL;
+               echo 'User-agent: ChatGPT-User' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               echo PHP_EOL;
+               echo 'User-agent: Google-Extended' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               echo PHP_EOL;
+               echo 'User-agent: GPTBot' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               System::exit();
        }
 }