• Anonymous

    Is it possible to make a weblog with wordpress that validates as HTML 4.01 Strict? I do not want a weblog which ist valid XHTML, ’cause I prefer HTML standarts to have a more accessable weblog.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Yes, but that does not make your blog more accessible than valid xhtml.

    Moderator James Huff

    (@macmanx)

    As long as your blog is valid something, it will be completely accessible (unless your readers are out of date by over five years).

    bendg

    (@bendg)

    It certainly is possible, I am doing just that for a site I’m developing. You need to change the doctype, the html begintag and you need to add a function to strip the endslashes on empty elements.

    Moderator Matt Mullenweg

    (@matt)

    function make_html($page) {
    return str_replace(' />', '>', $page);
    }
    ob_start('make_html');

    Try that out.

    Sorry to dig up such an old topic, but has anyone had any success with this? Might someone point me to exactly where I’d put the above function in my code? Thanks ??

    If serving XHTML as HTML really offends some people’s sensibilities (apparently it does), then one way around it is the way I do it for part of my site:

    In a .htaccess in the doc_root of your blog

    RewriteEngine on
    RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
    RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
    RewriteCond %{REQUEST_URI} \.php$
    RewriteCond %{THE_REQUEST} HTTP/1\.1
    RewriteRule .* – “[T=application/xhtml+xml; charset=utf-8]”

    This serves it is application/xhtml+xml to any user agent that supports that MIME type (nearly everything made in the last 6 or 7 years but IE) and leaves it as the page default, text/html, to those that don’t.

    As I said, it’s a major calamity to some people out there to see XHTML served as text/html and the “solution” I’ve provided should help out.

    LOL. I’d rather not hack a hack, but thanks very much for your post–very useful info ??

    As a joke, I’m going to switch to serving application/xhtml+xml with no negotiation and let my site die for IE users. Obviously, my site isn’t mission critical ??

    It won’t die; they’ll be prompted what to do with the page and if they select open it with IE, any other instances “should” open automagically. Who knows, though?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘valid HTML 4.01 Strict?’ is closed to new replies.