免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3069 | 回复: 0
打印 上一主题 下一主题

CI框架在nginx下rewrite的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-12-15 19:56 |只看该作者 |倒序浏览
本帖最后由 hao3721 于 2014-12-15 19:56 编辑

各位好,我用了CI框架,现有个需求想将

xxxx.com/game/info/28  替换成  xxxx.com/game/28.html
附本人的nginx.conf如下:
server
{
   listen 80;
   server_name xxxx.com;
   index index.html index.htm index.php default.html default.htm default.php;
   root /mnt/hgfs/xxxx.com;

   location ~ [^/]\.php(/|$)
     {
       try_files $uri =404;
       fastcgi_pass unix:/tmp/php-cgi.sock;
       fastcgi_index index.php;
       include fastcgi.conf;
       #include pathinfo.conf;
     }

   if (!-f $request_filename) {
     rewrite . /index.php last;
   }

   location ~*  /game/index{
        rewrite  /game/(\d*?).html  /index.php/game/index/$1   last;
   }


   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
     {
       expires 30d;
     }
   location ~ .*\.(js|css)?$
     {
       expires 12h;
     }
   access_log /home/wwwlogs/$server_name  access;
}

请问哪里不正确呢?应该怎么改正?谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP