From d69827cbe7cc6045d597fc4eebd585091d95eb00 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 21 Jul 2024 04:53:34 +0300 Subject: [PATCH] robots.txt --- app/Controllers/MainController.php | 7 +++++++ app/Core/Routes.php | 1 + 2 files changed, 8 insertions(+) diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php index 5aab448..54e603a 100644 --- a/app/Controllers/MainController.php +++ b/app/Controllers/MainController.php @@ -61,6 +61,13 @@ class MainController Page::set('FavAuthors'); } + public static function robots() { + echo 'User-Agent: * +Disallow: /lk/ +Clean-Param: vid&gid&upd /photo/ +Host: https://'.$_SERVER['SERVER_NAME']; +header("Content-Type: text/plain"); + } public static function logout() diff --git a/app/Core/Routes.php b/app/Core/Routes.php index 95d4f1a..b20d0ba 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -11,6 +11,7 @@ class Routes public static function init() { Router::get('/', 'MainController@i'); + Router::get('/robots.txt', 'MainController@robots'); Router::get('/t', 'MainController@t'); Router::get('/login', 'LoginController@i'); Router::get('/register', 'RegisterController@i');