求WORDPRESS运行在WDCP一键包,NGINX环境下,伪静态的方法!
求WORDPRESS运行在WDCP一键包,NGINX环境下,伪静态的方法!论坛搜索了几个不好用。
求详细教程,谢谢。 我试了一下 不是教程问题 。[code]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;
}
}
[/code]在其他的nginx都是可以用的 可是用在wdcp里却不能加.html 否则就404 具体原因正在分析中 重新发一个可以用的 亲测 nginx可用[code]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 last;
}[/code] 需要在nginx的配置文件引用为静态规则才可以使用,规则就如楼上的吧。 [b]回复 [url=http://www.wdlinux.cn/bbs/redirect.php?goto=findpost&pid=6230&ptid=1894]3#[/url] [i]shujun[/i] [/b]
好用
页:
[1]