龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開發(fā),龍巖分銷系統(tǒng)

thinkphp在nginx去掉index.php

2015.09.10 | 281閱讀 | 0條評(píng)論 | php

項(xiàng)目配置文件config.php

return array(

"URL_MODEL"=>2,    //關(guān)于URL更多說明請(qǐng)參考Tinkphp/Common/convention.php

);

復(fù)制代碼

配置Nginx.conf


在你的虛擬主機(jī)下添加


location / {

                if (!-e $request_filename){

                               rewrite ^/(.*)$ /index.php/$1 last;

                }

}


如果你的項(xiàng)目入口文件在一個(gè)子目錄內(nèi)則


location /目錄/ {

                if (!-e $request_filename){

                               rewrite ^/目錄/(.*)$ /目錄/index.php/$1 last;

                }

}


贊 (

發(fā)表評(píng)論