| |
    对于wordpress开启静态化url时如何在nginx下配置重写rewrite规则,网上一大抄的一个方式是说这样配置:

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

    看起来没什么错误,但实际使用中总发现静态文件也被rewrite走了,去nginx官网发现有了新参数:

    在location /段里加上一句:try_files $uri $uri/ /index.php?q=$uri&$args;


    ok了,轻松愉快。


by snooda | 分类: nginx | 评论(1) | 引用(0) | 阅读(5267)
yyyy
2012/11/08 14:17
stupidshuailovequestion
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]