htaccess fallback rule for webm video files

I would like to start using webm video files on my wordpress website.

Webm video files show correctly on Chrome and Firefox, but not on Internet Explorer.

So I'm trying to add an htaccess rule to replace webm with an mp4 file with same name when webm is unsupported by browser

But it does not work. Any hint would be greatly appreciated.

 RewriteCond %{HTTP_ACCEPT} !video/webm
 RewriteCond %{DOCUMENT_ROOT}/$1.mp4 -f
 RewriteRule (.+)\.webm$ $1.mp4 [T=video/mp4,E=REQUEST_video]


  • For those interested I've managed to find a working alternative solution with jQuery:

    function webm_fallback()
        if (is_single()) {
    // detect Internet Explorer
            if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )){
    // replace 
                    var source = $(this).attr('src');
                    $(this).attr('src',source.replace('.webm', '.mp4'));
    add_action('wp_head', 'webm_fallback');