Support » Plugins » [Plugin: W3 Total Cache] Minify rewrite rules

  • Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    This may have been addressed somewhere but I couldn’t find it and my PHP is lacking.

    With W3 Total Cache’s wp-content/w3tc/min/index.php what arguments does index.php expect? I’m asking because I want to get that working with NGINX.

    For example if I want to minify some CSS and I add them to the default group, in NGINX I can rewrite


    rewrite ^/wp-content/w3tc/min/default.include.css$ /wp-content/w3tc/min/index.php?gg=default&g=include&t=css last;

    Which almost works. I do get the minified CSS output but the page eventually times out instead of just completing. It’s like the webserver thinks there is more to send.

    I’m pretty sure I’m misinterpreting the /wp-content/w3tc/min/.htaccess rewrite rule and missing an argument. Naturally this works flawlessly in Apache2.

    # BEGIN W3TC Minify
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^([a-z0-9\-_]+)\.(include(-footer)?(-nb)?)\.(css|js)$ index.php?gg=$1&g=$2&t=$5 [L]
    # END W3TC Minify

    Any help would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • At any rate, if you succeed please post the rewrite rule you use – i’m also keen on using the plugin with NGINX.

    Maybe i get some spare time tomorrow to mess up one of my blogs 😉

    Sorry I don’t have time to focus on nginx right now, but if you contact me directly we can keep in touch.

    Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    Actually I got the confirmation I was looking for by switching back to Apache2 and adding rewritelog.conf in my /etc/apache2/conf.d/ directory with these lines:

    RewriteLog "/path/to/my/rewrite.log"
    RewriteLogLevel 9

    Which produced a metric ton of info 🙂 By grep’ing out “w3tc” I got the data I needed.

    And it did work for me provided I use minify to disk, it just worked slowly. I’ll keep pokeing at my nginx install and update here if I make any headway.

    Well done.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: W3 Total Cache] Minify rewrite rules’ is closed to new replies.