Board logo

标题: [已解决] 【已解决,在5楼】wordpress伪静态规则在WDCP2.0下面没效果 [打印本页]

作者: ftium4    时间: 2011-12-2 11:10     标题: 【已解决,在5楼】wordpress伪静态规则在WDCP2.0下面没效果

本帖最后由 ftium4 于 2011-12-3 10:28 编辑

内容我是按1.0版填的try_files $uri $uri/ /index.php?q=$request_uri;      
但是没用啊
作者: ftium4    时间: 2011-12-3 10:01

试了三个规则了,都没用,这是怎么回事啊!
作者: ftium4    时间: 2011-12-3 10:11

location / {
# if the requested file exists, return it immediately
if (-f $request_filename) {
break;
}

set $supercache_file '';
set $supercache_uri $request_uri;

if ($request_method = POST) {
set $supercache_uri '';
}

# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
set $supercache_uri '';
}

if ($http_cookie ~* "comment_author_|<span class="wp_keywordlink"><a href="http://www.xiaoboyang.com/category/wordpress-2" title="wordpress" target="_blank">wordpress</a></span>|wp-postpass_" ) {
set $supercache_uri '';
}

# if we haven't bypassed the cache, specify our supercache file
if ($supercache_uri ~ ^(.+)$) {
set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
}

# only rewrite to the supercache file if it actually exists
if (-f $document_root$supercache_file) {
rewrite ^(.*)$ $supercache_file break;
}

# all other requests go to WordPress
if (!-e $request_filename) {
rewrite . /index.php last;
}
}
这个也没用
作者: ftium4    时间: 2011-12-3 10:19

service nginxd restart
也没见到报错信息
作者: ftium4    时间: 2011-12-3 10:27

wo cao
用了
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;

}

终于成功了!
作者: Stone    时间: 2012-6-24 23:23

谢谢五楼的信息,WDCP 2.4 + WordPress 3.4测试成功!




欢迎光临 WDlinux官方论坛 (http://www.wdlinux.cn/bbs/) Powered by Discuz! 7.2