CI框架在nginx下rewrite的问题

moumouguo 2014-12-11 06:08:21
各位好,我用了CI框架,现有个需求想将

http://xxxx.com/game/info/28 替换成 http://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;
if (!-f $request_filename) {
rewrite . /index.php last;
}
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}

#rewrite /game/index/$1 /game/(.*?).html last;
rewrite /game/$1.html /game/index/(.*?) last;

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

请问哪里不正确呢?应该怎么改正?谢谢!
...全文
99 回复 打赏 收藏 举报
写回复
回复
切换为时间正序
请发表友善的回复…
发表回复
发帖
Framework

4249

社区成员

国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
帖子事件
创建了帖子
2014-12-11 06:08
社区公告
暂无公告