thinkphp URL 模式

兼容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

原文地址:https://www.cnblogs.com/microtiger/p/9003165.html