Chinaunix首页 | 论坛 | 博客
  • 博客访问: 656840
  • 博文数量: 121
  • 博客积分: 1425
  • 博客等级: 中尉
  • 技术积分: 2059
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-03 15:34
文章分类

全部博文(121)

文章存档

2018年(1)

2017年(2)

2016年(1)

2015年(11)

2014年(14)

2013年(47)

2012年(45)

分类: IT职场

2013-08-01 10:07:23

nginx  默认是没有支持thinkphp的url伪静态
在nginx的配置文件中加入以下的内容就可以支持url伪静态
还需要到thinkphp中把模式改为2
=====================================================================

  location / {
      index index.php;
      if (!-e $request_filename) {
          rewrite /(.*) /index.php/$1 last;
      }
      break;
  }

 

location ~ .+\.php($|/) {
    set $script    $uri;
    set $path_info  "/";
     if ($uri ~ "^(.+\.php)(/.+)") {
        set $script     $1;
        set $path_info  $2;
     }




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

这还需要到thinkphp中把模式改为1

阅读(1215) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~