“It appears Minify URL rewriting is not working” in W3TC + NGINX: w3tc_rewrite_test

I am running WordPress on NGINX and using W3TC for caching, however I was consistently getting the error "It appears Minify URL rewriting is not working" in the WordPress admin. After inspecting the code I found that there is a rewrite rule that is include in the .htaccess file for Apache, but as .htaccess isn’t supported for NGINX, it wasn’t properly handling the rewrite test. At issue is a check forĀ w3tc_rewrite_test which should be rewritten to W3TC. The following addition to my NGINX configuration cleared up the issue:

if (!-f $request_filename) {
  rewrite /w3tc_rewrite_test$ /wp-content/plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 permanent;

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *