WordPress + Nginx + Permalinks Rewrite rules


The following works for me:

  location /blog/ {
          index  index.php;
          # WordPress pretty URLs: (as per dominiek.com)
          if (-f $request_filename) {
                  break;
          }
          if (-d $request_filename) {
                  break;
          }
          rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last;

          # Enable nice permalinks for WordPress: (as per Yawn.it)
          error_page  404  = /blog/index.php?q=$uri;
  }

I have my blog here: http://www.trk7.com/blog/
and my permalink structure is: /%postname%/


Leave a Reply

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