Forum Moderators: open
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0\.?0*(\s|,|$)
RewriteCond %{REQUEST_URI} \.html$
RewriteRule .* - [T=application/xhtml+xml;charset=utf-8]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0\.?0*(\s|,|$)
RewriteCond %{REQUEST_URI} !\.
RewriteRule .* - [T=application/xhtml+xml;charset=utf-8]
Content-type: application/xhtml+xml; charset=utf-8
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule \.html$ - [T=application/xhtml+xml;charset=utf-8]
You essentially limit yourself in what you generate in your "(x)html" to make it so that it is both xhtml5 and HTML5 at the same time (they also focus a lot on having the same DOM, but that's only interesting if you mess with javascript - not something I'm all that interested in myself).
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title></head>
<body>
<table>
<tr><td></td></tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title></head>
<body>
<table>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</body>
</html>
if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")){
header('Content-Type: application/xhtml+xml;charset=UTF-8');
}
function myxmlencode($str) {
$in= array ('&','<','>','"',"'");
$out= array ('&','<','>','"','$apos;');
return(str_replace($in, $out, $str));
}