Здравствуйте.
 
	Такой вопрос.
 
	В корневом каталоге сайта есть два каталога:
 
	[php] -> содержит -> 1.php
 
	[error] -> содержит -> error.html и error.css
 
	error.html
 
<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8" />
  <title>ERROR</title>
<link rel="stylesheet" href="error.css">
 </head>
 <body>
  <p>Привет, мир</p>
 </body>
</html>
	1.php
 
<?php
	$SERVER_NAME = $_SERVER['SERVER_NAME'];
	$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
	
	$tpl = file_get_contents("http://".$SERVER_NAME."/error/error.html");
	//$tpl = file_get_contents($DOCUMENT_ROOT."/error/error.html");
	echo $tpl;
?>
	Теперь вопросы:
 
	1. Правильнее использовать SERVER_NAME или DOCUMENT_ROOT или ?
 
	2. При таком коде php я получу ошибку:
 
Refused to apply style from 'http://site.ru/php/error.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
	Как это исправить? Указывать полный путь к css файлу?
 
	или нечто такое:
 
	error.html
 
<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8" />
  <title>ERROR</title>
<link rel="stylesheet" href="{DOMAIN}/error/error.css">
 </head>
 <body>
  <p>Привет, мир</p>
 </body>
</html>
	1.php
 
<?php
	$SERVER_NAME = "http://" . $_SERVER['SERVER_NAME'];
	$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
	
	
	$tpl = file_get_contents($SERVER_NAME."/error/error.html");
	//$tpl = file_get_contents($DOCUMENT_ROOT."/error/error.html");
	$tpl = str_replace("{DOMAIN}", $SERVER_NAME."", $tpl);
	
	echo $tpl;
?>