Start by CentOS support php 5.3, I start to migrate from php-cgi to php-fpm.

Previously, I just use this rewrite rules for my WordPress setting:

    location / {
        #if (!-f $request-filename) { return 404; break; }
        rewrite "^/([^\.]*)$" /index.php?q=$1 last;
        root   /home/v/vaksin/;
        index  index.php index.html;
    }

 

But know since I use php-fpm, the rewrite rules above is not running well.

Now, I changed the configuration like this:

    location / {
        #if (!-f $request-filename) { return 404; break; }
        root   /home/v/vaksin/;
        index  index.php index.html;
            rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
            if (!-e $request_filename) {
                  rewrite ^.+/?(/wp-.*) $1 last;
                  rewrite ^.+/?(/.*\.php)$ $1 last;
                  rewrite ^(.+)$ /index.php?q=$1 last;
            }
    }

 

and this website now is back online :-)

*previously the problem is we can’t see the article detail, because it redirected to 404 (page not found).