valid HTML 4.01 Strict? (9 posts)

  1. Anonymous
    Posted 11 years ago #

    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.

  2. Mark (podz)
    Support Maven
    Posted 11 years ago #

    Yes, but that does not make your blog more accessible than valid xhtml.

  3. James Huff
    Volunteer Moderator
    Posted 11 years ago #

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

  4. BenDG
    Posted 11 years ago #

    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.

  5. Matt Mullenweg
    Posted 11 years ago #

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

    Try that out.

  6. allanh
    Posted 9 years ago #

    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 :)

    Posted 9 years ago #

    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.

  8. allanh
    Posted 9 years ago #

    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 ;)

    Posted 9 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.