robots.txtの追加
This commit is contained in:
@@ -21,6 +21,7 @@ if (DEBUG_MODE) {
|
||||
include(ROOT.'/util.php');
|
||||
|
||||
$routes = [
|
||||
Route::add('GET', 'robots.txt', Home::class.'@robots'),
|
||||
Route::add('GET', 'blog/{page}', Home::class.'@article'),
|
||||
Route::add('GET', 'about', Page::class.'@about'),
|
||||
Route::add('GET', 'monero', Page::class.'@monero'),
|
||||
|
||||
@@ -157,6 +157,15 @@ denyaccess:
|
||||
}
|
||||
}
|
||||
|
||||
public function robots(array $params): void {
|
||||
$txt = "User-Agent: *\nDisallow: /login/\nDisallow: /register/";
|
||||
$tmpFile = tempnam(sys_get_temp_dir(), 'tmpl_');
|
||||
file_put_contents($tmpFile, $txt);
|
||||
|
||||
include $tmpFile;
|
||||
unlink($tmpFile);
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// 機能性
|
||||
//------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user