Я объединяю все страницы сайта в один каталог с помощью этого кода if ( $_SERVER['REQUEST_URI'] == '/' ) $page = 'home'; else { $page = substr($_SERVER['REQUEST_URI'], 1); if ( !preg_match('/^[A-z0-9]{3,40}$/', $page) ) not_found(); session_start(); if ( file_exists("all/$page.php") ) include "all/$page.php"; else if ( $_SESSION['id'] == 1 and file_exists("auth/$page.php") ) include "auth/$page.php"; else if ( $_SESSION['id'] != 1 and file_exists("guest/$page.php") ) include "guest/$page.php"; else not_found(); function not_found() { exit('Страница 404'); Код if ( $_SERVER['REQUEST_URI'] == '/' ) $page = 'home'; else { $page = substr($_SERVER['REQUEST_URI'], 1); if ( !preg_match('/^[A-z0-9]{3,40}$/', $page) ) not_found(); session_start(); if ( file_exists("all/$page.php") ) include "all/$page.php"; else if ( $_SESSION['id'] == 1 and file_exists("auth/$page.php") ) include "auth/$page.php"; else if ( $_SESSION['id'] != 1 and file_exists("guest/$page.php") ) include "guest/$page.php"; else not_found(); function not_found() { exit('Страница 404'); и при попытке вызвать страницу которая лежит в quest у меня постояно выбивает ошибку из function not_found