• cycon

    (@cycon)


    Hello, i have a W3TC .htaccess code here:

    # BEGIN W3TC Skip 404 error handling by WordPress for static files
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_URI} !(robots\.txt|sitemap\.xml(\.gz)?)
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} \.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
        RewriteRule .* - [L]
    </IfModule>
    # END W3TC Skip 404 error handling by WordPress for static files

    This code asks Apache directly handle non-existent files with listed above extensions, not trowing them to following WordPress processing, correct?
    In my case I have a “ErrorDocument 404 /404.html” directive above W3TC directives and everything is great for requests like /abracadabra.gif or /wp-content/upload/abracadabra.gif.

    But if directory does not acrually exist like /wp-content/upload/someun-esisting-dir/abracadabra.gif – this request is being handled by WordPress.

    So, if directory for requested file does not exists, above W3TC directives does not work. And this is common 404 situation.

    To make it clear: I’m trying to forward all 404 responses to static file.

    Could not google anything on this. Any suggestions?

    https://www.ads-software.com/extend/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘W3TC .htaccess code for static does not always work?’ is closed to new replies.