全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: GoTop
打印 上一主题 下一主题

[疑问] 设置了wp super cache的rewrite规则之后,nginx提示错误

[复制链接]
11#
发表于 2010-5-6 22:08:32 | 只看该作者
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
                {
                        expires 30d;
                }
                location /
                {
                        autoindex off;
                        set $wp_super_cache_file '';
                        set $wp_super_cache_uri $request_uri;
                        if ( $request_method = POST )
                        {
                                set $wp_super_cache_uri '';
                        }
                        if ( $query_string )
                        {
                                set $wp_super_cache_uri '';
                        }
                        if ( $http_cookie ~* "comment_author_|WordPress|wp-postpass_" )
                        {
                                set $wp_super_cache_uri '';
                        }
                        if ( $wp_super_cache_uri ~ ^(.+)$ )
                        {
                                set $wp_super_cache_file /wp-content/cache/supercache/$http_host/$1index.html;
                        }
                        if ( -f $document_root$wp_super_cache_file )
                        {
                                rewrite ^(.*)$ $wp_super_cache_file break;
                        }
                        if (-f $request_filename)
                        {
                                expires 30d;
                                break;
                        }
                        if (!-e $request_filename)
                        {
                                rewrite ^(.+)$ /index.php last;
                        }
                }

我的,肯定对,正在用呢

评分

参与人数 1威望 +5 收起 理由
GoTop + 5 多谢

查看全部评分

12#
 楼主| 发表于 2010-5-7 12:16:16 | 只看该作者
原帖由 fish 于 2010-5-6 22:08 发表

我的,肯定对,正在用呢


用了你这个确实可以

但是下面这些,原来自带的这些rewrite规则不用要不要紧呢?
  1. if (-f $request_filename/index.html){
  2.                 rewrite (.*) $1/index.html break;
  3.         }
  4. if (-f $request_filename/index.php){
  5.                 rewrite (.*) $1/index.php;
  6.         }
  7. if (!-f $request_filename){
  8.                 rewrite (.*) /index.php;
  9.         }
复制代码
13#
发表于 2010-5-7 12:24:22 | 只看该作者

回复 12# 的帖子

不要紧
14#
 楼主| 发表于 2010-5-7 12:56:36 | 只看该作者
原帖由 fish 于 2010-5-7 12:24 发表
不要紧


那就好,谢谢啦~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-12 04:18 , Processed in 0.067682 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表