Разработка доски объявлений под ключ › Boxcode › Ошибки › Переадресация с несуществующих страниц › Ответ в теме: Переадресация с несуществующих страниц
07.11.2017 в 21:07
#2065

Хранитель
вот базовый код
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
<?php header ("Expire: Mon, 4 Apr 1995 01:01:01 GMT"); header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); //if (empty($dir_cms)) $dir_cms = realpath(dirname(__FILE__)); include_once ($dir_cms."/config/config.php"); include_once ($dir_cms."/config/db_config.php"); include_once ($dir_cms."/generalscript/glav_class_connect_baz.php");// файл содержит класс workBaz для покдлючения к базе данных include_once ($dir_cms."/generalscript/functiontext.php"); include_once ($dir_cms."/generalscript/list_functions.php"); include_once ($dir_cms."/generalscript/funct_obr_db_query.php"); include_once ($dir_cms."/generalscript/funct_save_error.php"); $url_site = "http://".$_SERVER["SERVER_NAME"].set_dir_from_path($_SERVER["SCRIPT_NAME"],0); //$dir_http = set_dir_from_path($_SERVER["SCRIPT_NAME"],0); $conect_file_modul_sitemap="on";//переменная для подлючаемых файлов модулей выдающих данные для sitemap.xml $error=0;$error_text="no"; $mas_sitemap = array(); $mas_sitemap[] = array( "loc" => $url_site."/sitemap_m_main.xml" ); $mas_sitemap[] = array( "loc" => $url_site."/sitemap_m_doska.xml" ); $mas_sitemap[] = array( "loc" => $url_site."/sitemap_m_catalog.xml" ); $mas_sitemap[] = array( "loc" => $url_site."/sitemap_m_article.xml" ); $text_xml = ""; $start_text_xml = '<?xml version="1.0" encoding="utf-8" ?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> '; $end_text_xml=" </sitemapindex>"; if ($error == 0) { foreach ($mas_sitemap as $one_sitemap ) { $text_xml.="<sitemap>\n"; foreach ($one_sitemap as $name_par => $value_par) { $text_xml.=" <".$name_par.">".htmlspecialchars($value_par,ENT_QUOTES)."</".$name_par.">\n"; } $text_xml.="</sitemap>\n"; } header ("Content-Type: text/xml; charset=utf-8"); echo ( $start_text_xml . $text_xml . $end_text_xml ); } |