W3 Total cache is a very powerful plugin and if handled properly, can improve performance of your wordpress a lot. But, at times it can lead to migraines of worst order. One such scenario is when you activate browser caching and suddenly pretty 500 errors are slapped.
If you just activated page caching and browser caching, and were shown 500 internal server error, here is a possible solution:
- Check your apache error logs.
- Most likely the latest error will be related to .htaccess, something like “ExpiresActive not allowed here”
- This is caused due to incompatible virtual hosts settings.
- Go to your virtual host settings and add AllowOverride Indexes to the relevant code block
For me it was:
<Directory /var/www/vhosts/domain.com> Options FollowSymLinks AllowOverride FileInfo Options Indexes Order allow,deny Allow from all </Directory>
I added Indexes to AllowOverride. I think the order doesnt matter.
And the issue was fixed.