nginx 環境 thinkphp 隱藏index.php


tp官網已經寫了 http://doc.thinkphp.cn/manual/hidden_index.html

 

不生效 重啟nginx .問題依舊

kill掉nginx進程  再啟動

貼段自己的配置:

server {
listen 80;
server_name url;
root /*/*/*;

#include conf.d/ipFilter.conf;
#access_log /data/logs/$server_name.access.log main;

if ($http_user_agent ~ "DNSPod") {

return 200;

}

try_files $uri $uri/ @rewrite;

#隱藏index.php

location / {

       if (!-e $request_filename) {

               rewrite ^(.*)$ /index.php?s=$1 last;
              break;

#pathinfo模式

location ~ \.php {

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM