posted on July 9, 2009

nginx下typecho的rewrite

Tagged Under : Typecho, LAMP, nginx, Rewirte

导数据到typecho的时候是在localhost的windows xp系统上用的apache,部署时用的是nginx
先是发现无法登陆按照这篇帖子内的方法配置了vhost.conf,发现可以登陆了,接着又出现了
无法编辑post的问题,具体症状见这篇帖子,甚是郁闷啊,google+baidu 找到一片描写wp的
rewrite的帖子,因typecho与wp笔记像,抱着试试看的想法,在测试站点试验了一下,嘿嘿
能用,转寄在此,备忘

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;
        }
    }

同时感谢Atlantis  :-)

  1. 熠熠 September 19th, 2009 at 08:09 pm
    熠熠

    大哥啊,我也遇到了啊,
    我的是 LINUX + apache, 那要怎么弄呢?
    是不是和你一样? 新建个 .htc啊?

    1. Marble.M.Wu Marble.M.Wu September 24th, 2009 at 04:22 pm

      Apache很好弄默认就支持的。

留下您的评论 »

captcha
请输入验证码