if ($_SERVER['SERVER_PORT'] != $default_port) { // Если нет, то добавим порт в URL $result .= ':' . $_SERVER['SERVER_PORT']; } // Последняя часть запроса (путь и GET-параметры). $result .= $_SERVER['REQUEST_URI']; // Уфф, вроде получилось! return $result; } error_reporting(0); session_start(); $alias = $_GET['alias']; define("ALIAS", $alias); include '_class.articles.php'; $article = new articles(); $article->get_article_by_alias($alias); //echo "<script>alert('".$article->category_alias."')</script>"; define("PAGE_IDENTIFY", "{$article->category_alias}"); //define ("PAGE_IDENTIFY", "articles"); define("TITLE_WORDS", "{$article->title}"); define("KEY_WORDS", "{$article->keywords}"); define("PATH_TO_ROOT", "http://www.ladystyle.su/"); define("DESCRIPTION", "{$article->subtitle}"); if ($article->undefined != 1) { header('HTTP/1.1 404 Not Found'); header('Location:http://www.ladystyle.su/template/404.php'); exit; } $foo = request_url(); if (strrpos($foo, '?alias=', 0) != FALSE) { header("HTTP/1.1 301 Moved Permanently");