php error_reporting E_ALL E_NOTICE define __XUJ__ true require_once Co

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
error_reporting(E_ALL | E_NOTICE);
define('__XUJ__', true);
require_once 'Core/Core.class.php';
$real_server_name = str_replace('www.', '', $_SERVER['HTTP_HOST']);
if($real_server_name != $_SERVER['HTTP_HOST']) {
header('Location: http://'.$real_server_name);
exit;
}
$section = explode('/', preg_replace('/\/?\?(.*?)$/', '', substr(preg_replace('/\/+/', '/', $_SERVER['REQUEST_URI']), 1)));
switch($section[0]) {
case '404':
echo 'Ошибка 404';
break;
case '403':
echo 'Ошибка 403';
break;
default:
if(empty($section[0])) {
echo 'Home Page!';
}
else {
header('Location: /404/');
exit;
}
break;
}