<?php
$file = $_SERVER['DOCUMENT_ROOT'] .  $_SERVER['REQUEST_URI'];
if(!file_exists($file)){
    http_response_code(404);
    die();
}
$extension = explode('.',$file, 2)[1];
if($extension === 'txt'){
    $extension = 'plain';
}
$str = file_get_contents($file);
$str = str_replace("zonabelya.ru", explode(':', $_SERVER["HTTP_HOST"], 2)[0], $str);
header('Content-Type: text/'.$extension.'; charset=utf-8');
if($_SERVER["HTTP_HOST"] == "msk.zonabelya.ru:443"){
    echo "User-agent: *".PHP_EOL;
    echo "Disallow: /";
}else{
    echo $str;

}



