$LastModified_unix = strtotime(date("D, d M Y H:i:s", filectime($_SERVER['SCRIPT_FILENAME'])));
$LastModified = gmdate("D, d M Y H:i:s \G\M\T", $LastModified_unix);
$IfModifiedSince = false; if (isset($_ENV['HTTP_IF_MODIFIED_SINCE']))
$IfModifiedSince = strtotime(substr ($_ENV['HTTP_IF_MODIFIED_SINCE'], 5));
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
$IfModifiedSince = strtotime(substr ($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5));
if ($IfModifiedSince && $IfModifiedSince >= $LastModified_unix) {
header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
exit; }
header('Last-Modified: '. $LastModified);
<li class="mlink dep_selector bold underline" id="country62"><span>Магаданская область</span><!----></li>
public function initLiveSiteUrl()
{
global $location_array;
global $settings;
if (!$settings["enable_subdomains"] || !$settings["subdomain_field"]) {
return NULL;
}
global $config_live_site;
$get_city = "";
$cookie_city = "";
if (isset($location_array[$settings["subdomain_f ield"]])) {
$cookie_city = $this->buildLocationSubdomain($location_array[$ settings["subdomain_field"]]);
}
if ($cookie_city) {
if (stristr($config_live_site, "www")) {
$config_live_site = str_replace("www.", "https://" . $cookie_city . ".", $config_live_site);
return NULL;
}
$config_live_site = str_replace("https://", "https://" . $cookie_city . ".", $config_live_site);
}
}
public function checkCrtLocation(&$smarty)
{
global $location_array;
global $settings;
global $crt_city;
global $main_domain;
global $config_live_site;
$get_city = "";
$cookie_city = "";
$new_city = "";
if (isset($_GET["crt_city"]) && $_GET["crt_city"]) {
$get_city = $_GET["crt_city"];
}
if (isset($location_array[$settings["subdomain_f ield"]])) {
$cookie_city = $this->buildLocationSubdomain($location_array[$ settings["subdomain_field"]]);
}
if (($get_city && $get_city != "m" || isset($_SESSION["location_set"]) && $_SESSION["location_set"]) && $get_city != $cookie_city) {
if ($_SESSION["location_set"]) {
$new_city = $cookie_city;
if (getScriptName() != "show_locations.php") {
$_SESSION["location_set"] = 0;
}
} else {
$city_name = "";
if ($get_city) {
$city_name = $this->getLocationName($settings["subdomai n_field"], $get_city);
}
$expire = time() + 60 * 60 * 24 * 365;
setcookie("location_" . $settings["subdomain_field"], $city_name, $expire, "/", "." . $main_domain);
if ($city_name) {
$new_city = $get_city;
}
}
if ($new_city) {
header("Location: https://" . $new_city . "." . $main_domain . $_SERVER["REQUEST_URI"]);
} else {
$s = substr_count($config_live_site, "www") ? "www." : "";
header("Location: https://" . $s . $main_domain . $_SERVER["REQUEST_URI"]);
}
exit(0);
}
if ($cookie_city && $get_city != "m" && $cookie_city != $get_city) {
header("Location: http://" . $cookie_city . "." . $main_domain . $_SERVER["REQUEST_URI"]);
exit(0);
}
if ($cookie_city) {
if (stristr($config_live_site, "www")) {
$config_live_site = str_replace("www.", "https://" . $cookie_city . ".", $config_live_site);
} else {
$config_live_site = str_replace("https://", "https://" . $cookie_city . ".", $config_live_site);
}
}
$domain_name = str_replace("https://", "", $config_live_site);
if ($smarty) {
$smarty->assign("live_site", $config_live_site);
$smarty->assign("domain_name", $domain_name);
$smarty->assign("main_domain", $main_domain);
}
}
RewriteCond %{HTTP_HOST} !www.site.ru$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_]+).site.ru [NC]
RewriteRule (.*) %{SCRIPT_FILENAME}?crt_city=%2 [NC,QSA]
Not Found
The requested URL /new_posting.php was not found on this server.
Apache/2.2.15 (CentOS) Server at magadanskaya-oblast.site.ru Port 443