thinkphp 3.2 linux二級目錄安裝
詳解:
注意:linux系統對大小寫敏感
服務器系統:linux (阿里雲服務器)
thinkphp 版本: 3.2
1. 修改nginx配置 (提示找不到控制器,頁面空白等問題) 阿里雲文件ftp位置:/etc/nginx/conf.d/default.conf
<span style="color: rgb(255, 102, 0);">注意:在Nginx低版本中,是不支持PATHINFO的,但是可以通過在Nginx.conf中配置轉發規則實現(如果服務器支持pathinfo則不用以下代碼):</span>
增加代碼
(根目錄下安裝)
location / { // …..省略部分代碼 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } }
(二級目錄安裝)
location /youdomain/ { if (!-e $request_filename){ rewrite ^/youdomain/(.*)$ /youdomain/index.php?s=$1 last; } }
2.修改URL_MODEL連接模式
'URL_MODEL' =>'1', // config.php文件中
3.模板文件命名規范
goods_index.html 錯誤(linux系統對大小寫敏感);Goods_index.html 正確