• Resolved frenchomatic

    (@frenchomatic)


    Hi,

    I seem to be having some problems when using W3 total cache with the Ninja firewall and it is difficult to pin down exactly why. However, it appears to be the page caching part that is now throwing 403 errors.

    If I remove the part which is in bold and just keep browser caching the issue goes way. Something in the page caching appears to be making a conflict.

    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
    <IfModule mod_headers.c>
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
    <IfModule mod_mime.c>
    # DEFLATE by extension
    AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
    </IfModule>
    <FilesMatch “\.(bmp|class|doc|docx|eot|exe|ico|json|mdb|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|JSON|MDB|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$”>
    <IfModule mod_headers.c>
    Header unset Last-Modified
    </IfModule>
    </FilesMatch>
    # END W3TC Browser Cache
    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} =on
    RewriteRule .* – [E=W3TC_SSL:_ssl]
    RewriteCond %{SERVER_PORT} =443
    RewriteRule .* – [E=W3TC_SSL:_ssl]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* – [E=W3TC_ENC:_gzip]
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* – [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =””
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond “%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” -f
    RewriteRule .* “/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” [L]
    </IfModule>
    # END W3TC Page Cache core

    I understand this is a tricky one. I am at the point of throwing W3 total cache away. It never plays nice with anything. However, what is the real alternative.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter frenchomatic

    (@frenchomatic)

    I set debugging mode and turned live log on. The only things that comes up apart from a 403 (difeerent browser – not looged in) is this

    [13/Jan/17:12:41:41 +0000] – X.X.X.X “GET /favicon.ico” “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:50.0) Gecko/20100101 Firefox/50.0” “X.X.X.X” “www.mydomain.com”

    X.X.X.X is my IP address of course.

    • This reply was modified 7 years, 10 months ago by frenchomatic.
    Thread Starter frenchomatic

    (@frenchomatic)

    Forget that – I just get a 403.

    Plugin Author nintechnet

    (@nintechnet)

    I can’t reproduce your issue. I copied/pasted your .htaccess and it did not throw any error with W3 Total Cache;

    Maybe it is a SSL/HTTPS issue?

    You can try to disable one by one the instructions from the “BEGIN W3TC Page Cache core” section in order to find out which one is the problem.
    Also, did you check your server HTTP error logs?

    Regarding “Live Log”, if you are using the option that makes use of static HTML files and a visitor request a page, you won’t see anything because it will be served from Apache which will shortcut PHP (and NinjaFirewall). You will only see requests that aren’t cached, such as a URL with a query string ( /index.php?something ) or POST requests etc.

    • This reply was modified 7 years, 10 months ago by nintechnet.
    Thread Starter frenchomatic

    (@frenchomatic)

    I will get to work on this and come back if and when a soltion is found so that others who have this issue may end up with a solution.

    Thread Starter frenchomatic

    (@frenchomatic)

    Reinstalled W3 total cache and the error disappeared.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘W3 Total cache conflict’ is closed to new replies.