Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am having an issue with enabling minify with the W3TC plugin. I am using a LEMP stack and cloudfront as a CDN, and all of these features, except for the minify work fine. In order to enable fancy permaplinks in WP I added /index.php?q=$uri&$args to the try_files line in sites-available and now all of the permalinks are /index.php/postname/ which I think may have something to do with these errors.

share|improve this question

closed as off-topic by Mark Kaplun, birgire, Rarst Aug 22 at 20:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

    
Had you tried contacting plugin's developer? It's too specific setup to easily replicate and look into the issue. –  Rarst May 4 '13 at 19:35
    
To fix the permalinks, you may want let WP know that Nginx supports rewrites. To do that, you may insert add_filter( 'got_rewrite', '__return_true' ); in your theme's functions.php file. Then, please make sure to update the permalinks settings. Finally, try minify in W3TC. I hope that helps. –  Pothi May 7 '13 at 14:34
    
@PothiKalimuthu that fixed the index.php issue but not the minify issue. Any idea what I can do for that? –  Zach Russell May 7 '13 at 18:33
    
Please provide more information on what's happening when you enable minify in W3TC in order to help with your issue better. –  Pothi May 8 '13 at 2:26
    
I get this errpr It appears Minify URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess. Or if using nginx verify all configuration files are included in the main configuration fail (and that you have reloaded / restarted nginx). and the CSS on the page breaks @PothiKalimuthu –  Zach Russell May 8 '13 at 20:08

1 Answer 1

up vote 1 down vote accepted

Try using the following for your rewrite rules:

location / {
     try_files $uri $uri/ /index.php$is_args$args;
}

Using that schema, you can manually remove index.php from your Permalinks settings without breaking anything. Nginx will now check any URI for its existence as a file on the filesystem, and then a directory on the filesystem, and if neither of those return a valid entry it hands off the entire URI to index.php to process, complete with any query strings if any are present.

For W3 Total Cache, try the following: W3 Total Cache Minify Rewrite Error with Wordpress on nginx

share|improve this answer
    
Thanks so much! –  Zach Russell Jun 1 '13 at 23:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.