We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11337
    • 19 Posts
    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 sad

    PS. It would be great to resolving this problem or put it into modx wishlist!
      • 25663 MODX Staff
      • 12,272 Posts
      Not quite certain what you’re trying to do, but the next (in a few minutes now!!!) release will have different mime-types and content dispostions available.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 11337
        • 19 Posts
        Not quite certain what you’re trying to do

        "XHTML should be delivered as application/xhtml+xml. Most modern browsers, with the exception of Internet Explorer 6, support the MIME type application/xhtml+xml.
        so I want put text/html only for IE smiley)
        but the next (in a few minutes now!!!) release will have different mime-types
        few minutes I can wait smiley) but Im really interesting to resolve this now- before next release appear.
          • 25663 MODX Staff
          • 12,272 Posts
          too late smiley
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 11337
            • 19 Posts
            yeah smiley)