• Hello all, & Frederick,

    Thanks for your consistent and prompt support on this plugin. It gives me confidence to ask for assistance. πŸ™‚

    When I installed and configured w3 total cache, with all its default settings, I immediately got a 500 error on the front end. The dashboard works as normal.

    I also have a MaxCDN account configured correctly with W3 total cache.

    Are you familiar with the causes of this error?

    My first instinct to deal with this was to check the .htaccess file and of course, w3 cache has made some changes.

    This is what my .htaccess file contains:

    # 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 CDN
    <FilesMatch “\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|WOFF|XLA|XLS|XLSX|XLT|XLW|ZIP)$”>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule .* – [E=CANONICAL:http://eduwebcollege.com%{REQUEST_URI},NE]
    RewriteCond %{HTTPS} =on
    RewriteRule .* – [E=CANONICAL:https://eduwebcollege.com%{REQUEST_URI},NE]
    </IfModule>
    <IfModule mod_headers.c>
    Header set Link “<%{CANONICAL}e>; rel=\”canonical\””
    </IfModule>
    </FilesMatch>
    <FilesMatch “\.(ttf|ttc|otf|eot|woff|font.css)$”>
    <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin “*”
    </IfModule>
    </FilesMatch>
    # END W3TC CDN
    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    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_PREVIEW}.html%{ENV:W3TC_ENC}” -f
    RewriteRule .* “/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” [L]
    </IfModule>
    # END W3TC Page Cache core
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    What do you think would have caused the error from this file? or is it something else?

    Thank you,
    -C

    https://wordpress.org/plugins/w3-total-cache/

Viewing 9 replies - 1 through 9 (of 9 total)
  • 500 huh? Yea first thing i thought was a misconfigured htaccess file. Can u disable CDN from w3tc and see if it can properly access your resources locally without the 500 error. I want to better pinpoint what is causing the problem. I assume all the necessary files for your site are also available locally and not solely on the remote cdn.

    Thread Starter ctJemm

    (@ctjemm)

    Sure, Kimberly I can try this. However, this issue happened before I configured maxCDN, I never did quite get to see how the CDN even worked (!) However, as I typed this, I have done it, and the 500 error still occurs.

    Alternatively, I’ve disabled all the other features (except) maxCDN, and, it works!

    Yes, all the files are available locally as well. <:

    So I think the issue is with the minify settings, and all others, not the CDN configuration?

    Thread Starter ctJemm

    (@ctjemm)

    Contents of the new .htaccess file that works:
    # 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 CDN
    <FilesMatch “\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|WOFF|XLA|XLS|XLSX|XLT|XLW|ZIP)$”>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule .* – [E=CANONICAL:http://eduwebcollege.com%{REQUEST_URI},NE]
    RewriteCond %{HTTPS} =on
    RewriteRule .* – [E=CANONICAL:https://eduwebcollege.com%{REQUEST_URI},NE]
    </IfModule>
    <IfModule mod_headers.c>
    Header set Link “<%{CANONICAL}e>; rel=\”canonical\””
    </IfModule>
    </FilesMatch>
    <FilesMatch “\.(ttf|ttc|otf|eot|woff|font.css)$”>
    <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin “*”
    </IfModule>
    </FilesMatch>
    # END W3TC CDN
    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    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_PREVIEW}.html%{ENV:W3TC_ENC}” -f
    RewriteRule .* “/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}” [L]
    </IfModule>
    # END W3TC Page Cache core
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Ahh..very interesting. Just to make sure, so that we are on the same page. The only thing that is disabled is the minify settings and as of right now everything is working fine? I see your .htaccess is identical to your OP which must mean the minify is the only thing, but just want to make sure.

    That’s very good to know.

    Hey try re-enabling minify HOWEVER, under the Minify settings area disable minification for javascript (so only css gets minified). And then see if things still work? If it still works (or not) reverse it — try disabling css minification and enabling javascript minification. I assume you have minification set to “Auto”?

    I am curious to try to narrowing this problem down s’more.

    I’m starting to think we may need to set your minify mode to “manual” instead of auto. I am wondering if w3tc’s auto is getting hung up in some internal race condition…yikes! We’ll try manual mode later.

    Thread Starter ctJemm

    (@ctjemm)

    Oh, no, just to be clear, the only thing activated is CDN. Everything else is unchecked.

    Hold a moment, I’m typing another response now…

    Thread Starter ctJemm

    (@ctjemm)

    I ran a filediff on both items, and there’re no differences between one and another (except indentation because I copy-pasted from this thread) : https://www.diffchecker.com/uu7jkkyx

    Thread Starter ctJemm

    (@ctjemm)

    So! I re-enabled minify, with settings on auto. Now, minify and maxCDN are running (no other options, such as page, database, object and browser cache etc.). It is still working. And it’s set to ‘auto’, with all the default options assigned.

    Ok…try enabling page caching now too. So this would mean you will now have minify, maxCDN and page cache (“Disk Enhanced”) enabled only. Things should still work.

    Btw, although u have them off now i am curious were u using database and/or object caching before?

    Thread Starter ctJemm

    (@ctjemm)

    Just enabled page, object, and database cache, and all is well! So I think we’ve zeroed in on Reverse proxy settings, NewRelic monitoring (which i have never enabled, not when I had error 500 either), and verifying the rewrite rules in the misc. options. None of which I think I need?

    Thank you so so much for this!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘500 error’ is closed to new replies.