一、配置流程

1、添加域名,建立主机

lnmp vhost add

2、修改.conf文件

cd /usr/local/nginx/conf/vhost
if ($host != 'wpcdeckingfloor.com') {
rewrite ^/(.*)$ http://wpcdeckingfloor.com/$1 permanent;
}
include /home/wwwroot/wpcdeckingfloor.com/.htaccess;
修改other.conf 为wordpress.conf

3、上传.htaccess文件

#注意事项及问题解决

1、配置kiss(首页访问必须带index.php问题)
修改wordpress伪静态文件,去除:

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

需要加下列代码(一般是在/usr/local/nginx/conf/)下的”wordpress.conf”,一般是有的。

location / {
if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
        }
if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
        }
if (!-f $request_filename){
                rewrite (.*) /index.php;
        }
}