• Similar to this post (https://www.ads-software.com/support/topic/plugin-w3-total-cache-error-403-forbidden), I am getting 403 Forbidden errors on cached pages when I use Disk:Enhanced Page Cache.

    Disk:Basic works fine for Page Cache. Opcode APC also works fine for Page Cache, but doesn’t actually cache any pages on the server (i.e. no static hml pages get created when the page is visited regardless of whether I am logged in or not when viewing the pages in a browser).

    My root htaccess file has these directives in it:

    # 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/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    # END W3TC Browser Cache
    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteRule .* - [E=W3TC_ENC:_gzip]
        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.html%{ENV:W3TC_ENC}" -f
        RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html%{ENV:W3TC_ENC}" [L]
    </IfModule>
    # END W3TC Page Cache core

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

Viewing 9 replies - 16 through 24 (of 24 total)
  • I’m not too familiar with all the rewrite rules. However, I think you may want to try something like…

    RewriteCond %{REQUEST_URI} !*._index.html$

    You may put the above rule, just above the last rewrite rule in that htaccess file.

    Initially, you may try renaming the entire htaccess file. When renamed, if 403 errors disappear, then you may revert the process and then insert the above rule.

    Thread Starter skepticwebguy

    (@skepticwebguy)

    I decided to see if there was an update to the 5G Firewall and there was. So, I applied inserted those htaccess rules instead and now Disk:Enhanced Page Caching works!

    https://perishablepress.com/5g-blacklist-2013/

    The way some of those rules were written changed in the new 5G Firewall update.

    Glad to know that.

    Thread Starter skepticwebguy

    (@skepticwebguy)

    Thank you very much for your help. Really great!

    I am also getting 403 forbidden errors when the plugin is activated.

    I have the W3 installed in 5 websites. In one of them, the site works fine from any browser, but when I’m trying to access it through a “page loading test” site (e.x. pingdom.com, websiteoptimization.com, uptimerobot.com) the site always reports Forbidden 403 error! When I uninstall the plugin, the problem is fixed. I really don’t know what to do to keep W3 enabled and to avoid 403 Error ??

    Updating… When I change on “Page Cache Method” from “Disk: Enhanced” to “Disk: Basic” the Forbidden 403 Error stopped showing up. Any idea how to enable “Disk: Enhanced” and stop with the Forbidden 403 Error?

    Just an update to help someone having the same issue… I’ve fixed the problem following the steps below ??

    In public_html/wp-content/cache/page_enhanced/www.mysite.com there were 2 files, _index.html.old and _index.html_gzip.old. There was also a public_html/wp-content/cache/page_enhanced/www.mysite.com/.htaccess folder and inside it there were 2 files, _index.html and _index.html_gzip.

    So I renamed .htaccess folder to .htaccess_old and also the files inside to _index.html.old and _index.html_gzip.old.

    Then I renamed the _index.html.old and _index.html_gzip.old from inside public_html/wp-content/cache/page_enhanced/www.mysite.com to _index.html and _index.html_gzip.

    So the problem was fixed and I was able to enable page cache disk enhanced mode.

    JuniorBra: thank you very much for the tip!

    I was having the same problem with all the single post pages – they generated a 403 Forbidden error when accessed by online services like Facebook and W3C validator. Just renaming the .htaccess folder and the files inside it solved the issue.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Error 403 Forbidden using Disk:Enhanced Page Cache’ is closed to new replies.