Simple robots.txt for server 404 log

This commit is contained in:
Denis Chenu 2017-04-26 15:39:35 +02:00
parent 0b8f80c747
commit 4942c97785

29
mod/robots_txt.php Normal file
View File

@ -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();
}