File manager - Edit - /home/c14075/dragmet-ural.ru/www/robots.php.tar
Back
home/c14075/dragmet-ural.ru/www/robots.php 0000644 00000001430 15132023312 0014163 0 ustar 00 <? $arHost = explode( ":", $_SERVER["HTTP_HOST"]); $_SERVER["HTTP_HOST"] = $arHost[0]; $hostname = $_SERVER['HTTP_HOST']; function echoTextFile($file) { if (! file_exists($file)) return false; if (! is_readable($file)) return false; $timestamp = filemtime($file); $tsstring = gmdate('D, d M Y H:i:s ', $timestamp) . 'GMT'; $etag = md5($file . $timestamp); header('Content-Type: text/plain'); header('Content-Length: '.filesize($file)); header("Last-Modified: $tsstring"); header("ETag: \"{$etag}\""); readfile($file); return true; } $robotsHost = dirname(__FILE__) . "/aspro_regions/robots/robots_{$hostname}.txt"; $robotsDefault = dirname(__FILE__) . "/robots.txt"; if(!echoTextFile($robotsHost) && !echoTextFile($robotsDefault)) { header('HTTP/1.0 404 Not Found'); } home/c14075/s2.na4u.ru/www/robots.php 0000644 00000001430 15133230506 0012777 0 ustar 00 <? $arHost = explode( ":", $_SERVER["HTTP_HOST"]); $_SERVER["HTTP_HOST"] = $arHost[0]; $hostname = $_SERVER['HTTP_HOST']; function echoTextFile($file) { if (! file_exists($file)) return false; if (! is_readable($file)) return false; $timestamp = filemtime($file); $tsstring = gmdate('D, d M Y H:i:s ', $timestamp) . 'GMT'; $etag = md5($file . $timestamp); header('Content-Type: text/plain'); header('Content-Length: '.filesize($file)); header("Last-Modified: $tsstring"); header("ETag: \"{$etag}\""); readfile($file); return true; } $robotsHost = dirname(__FILE__) . "/aspro_regions/robots/robots_{$hostname}.txt"; $robotsDefault = dirname(__FILE__) . "/robots.txt"; if(!echoTextFile($robotsHost) && !echoTextFile($robotsDefault)) { header('HTTP/1.0 404 Not Found'); } home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/landing/lib/hook/page/robots.php 0000644 00000002263 15150400446 0023263 0 ustar 00 <?php namespace Bitrix\Landing\Hook\Page; use \Bitrix\Landing\Field; use \Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__); class Robots extends \Bitrix\Landing\Hook\Page { /** * Map of the field. * @return array */ protected function getMap() { return array( 'USE' => new Field\Checkbox('USE', array( 'title' => Loc::getMessage('LANDING_HOOK_ROBOTS_USE') )), 'CONTENT' => new Field\Textarea('CONTENT', array( 'title' => Loc::getMessage('LANDING_HOOK_ROBOTS_CONTENT'), 'placeholder' => 'User-agent: Google Allow: /folder1/ Disallow: /file1.html Host: www.site.com User-agent: * Disallow: /document.php' )) ); } /** * Title of Hook, if you want. * @return string */ public function getTitle() { return Loc::getMessage('LANDING_HOOK_ROBOTS_NAME'); } /** * Exec or not hook in edit mode. * @return boolean */ public function enabledInEditMode() { return false; } /** * Enable or not the hook. * @return boolean */ public function enabled() { return $this->fields['USE']->getValue() == 'Y'; } /** * Exec hook. * @return string */ public function exec() { return $this->fields['CONTENT']->getValue(); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings