WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Minify rewrite rules (5 posts)

  1. 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

    http://myblog.url.com/wp-content/w3tc/min/default.include.css

    to

    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]
    </IfModule>
    # END W3TC Minify

    Any help would be appreciated.

  2. moepstar
    Member
    Posted 4 years ago #

    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 ;)

  3. Frederick Townes
    Member
    Posted 4 years ago #

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

  4. 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.

  5. Frederick Townes
    Member
    Posted 4 years ago #

    Well done.

Topic Closed

This topic has been closed to new replies.

About this Topic