全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
楼主: 遍地阳光
打印 上一主题 下一主题

nginx下的wordpress固定连接

[复制链接]
61#
发表于 2009-11-1 23:15:18 | 只看该作者
原帖由 遍地阳光 于 2009-11-1 23:12 发表
我马上试试去。嘿嘿。


要注意这样根目录的错误路径也会被转到子目录
62#
 楼主| 发表于 2009-11-1 23:19:57 | 只看该作者

回复 61# 的帖子

这样还是不行。啊。


server
        {
                listen       80;
                server_name 我的域名;
                index index.html index.htm index.php;
                root  /home/www/我的目录;

                #limit_conn   crawler  20;

                #location /status {
                #stub_status    on;
                #access_log     off;
                #}

                if (!-e $request_filename) {
                        rewrite ^(.*)$ /blog/index.php?q=$1 last;
                }

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                #fastcgi_pass  127.0.0.1:9000;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_format  access1  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /web/logs/access.log  access;
        }
63#
发表于 2009-11-2 12:31:45 | 只看该作者
你们在干嘛呢
64#
发表于 2009-11-2 12:40:30 | 只看该作者
忘了关键性问题,你在后台设置了没有?固定链接那里,截个图出来,再把你的WP地址发出来。
65#
发表于 2009-11-2 13:13:25 | 只看该作者
原帖由 qwe123 于 2009-11-2 12:31 发表
你们在干嘛呢


在讨论nginx环境下,子目录安装WordPress怎么伪静态。
66#
发表于 2010-1-26 17:55:50 | 只看该作者
这么久了,不知道楼主弄出来没有

我试过,这样是没问题的, 假设你的子目录是blog,

location /blog/ {
                if (!-e $request_filename) {
                        rewrite ^(.*)$ /blog/index.php?q=$1 last;
                }
}

67#
发表于 2010-1-26 20:14:39 | 只看该作者

回复 66# 的帖子

确认这样可以么? 原来子目录这么弄。
68#
发表于 2010-1-26 20:17:54 | 只看该作者
nginx还真有点麻烦
69#
发表于 2010-1-26 21:04:31 | 只看该作者

回复 67# 的帖子

恩,确认可以的,可以看这里
http://www.lixing.org/wp-demo/google/

wp-demo是wp的子目录,google是/%postname%/
70#
发表于 2010-1-26 21:20:36 | 只看该作者

回复 69# 的帖子

嘿嘿,学习了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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