Hi.
Im interesting in using ’content negotiation’ (
http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation) on my site.
I have found nice script:
<?php
$xhtml = false;
if
(preg_match('/application\/xhtml\+xml(?![+a-z])(;q=(0\.\d{1,3}|[01]))?/i', $_SERVER['HTTP_ACCEPT'], $matches)) {
$xhtmlQ = isset($matches[2])?($matches[2]+0.2):1;
if (preg_match('/text\/html(;q=(0\d{1,3}|[01]))s?/i', $_SERVER['HTTP_ACCEPT'], $matches)) {
$htmlQ = isset($matches[2]) ? $matches[2] : 1;
$xhtml = ($xhtmlQ >= $htmlQ);
} else {
$xhtml = true;
}
}
if ($xhtml) {
header('Content-Type: application/xhtml+xml; charset=utf-8');
} else {
header('Content-Type: text/html; charset=utf-8');
}
?>
The main problem is that I’m not a php programmer... so... I don’t know how to set up it in to mutate_content.dynamic.action.php
PS. It would be great to resolving this problem or put it into modx wishlist!