兼容ThinkPHP三种url模式的nginx rewrite

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

'URL_MODEL'=>2, 设置

URL模式 URL_MODEL设置
普通模式 0
PATHINFO模式 1
REWRITE模式 2
兼容模式 3

 

 

 

 

 

http://document.thinkphp.cn/manual_3_2.html#url

相关文章:

  • 2021-06-07
  • 2021-08-01
  • 2021-06-20
  • 2022-12-23
  • 2021-09-29
  • 2018-01-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案