\s*(.*)'; //die($regex); if (preg_match("#\s/$regex#", $routes, $matches)) { $routed_file = trim($matches[1]); //sdie($routed_file); if (file_exists($routed_file)) { $page = file_get_contents($routed_file); } else { die_not_found($p); } } else { die_not_found($p); } } else { $page = file_get_contents($p); } if ($assert['head']) $page = preg_replace('##i', $assert['head'].'', $page); if ($assert['begin']) $page = preg_replace('##i',''.$assert['begin'], $page); if ($assert['end']) $page = preg_replace('##i', $assert['end'].'', $page); //SAPE на сервере k0xa'и нельзя подключить в целях безопасности :) //у вас же все будет работать ОК if (!defined('K0XA_SERVER')) { if (file_exists($d.'/sape.php') && file_exists($d.'/sape_conf.php')) { include_once($d.'/sape_conf.php'); include_once($d.'/sape.php'); // $sape = new SAPE_client(array('charset'=>'utf-8', 'force_show_code' => true)); $sape = new SAPE_client(array('charset'=>'utf-8')); $page = preg_replace('#\{SAPE\((\d+)\)\}#e', '$sape->return_links($1)', $page); } } echo $page; function die_not_found($page) { $text = <<< EOH 404 Not Found

Not Found

The requested URL /$page was not found on this server.


Apache/2.2.13 (Ubuntu) Server at $_SERVER[HTTP_HOST] Port 80
EOH ; die($text); } ?>