WordPress Nginx伪静态

先建立一个nginx.conf 文件,然后填入以下内容:

location / {

    index index.html index.php;

    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;

    }

}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

二级目录下静态化

location /idcnews/

{
index index.html index.php;
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 (.*) /idcnews/index.php;
}
}

© 版权声明
THE END
請多多支持
点赞0
相关推荐
评论 抢沙发

    暂无评论内容