phpthink 隐藏index.php,nginx 配置--支持phpthink框架 path_info
server?{
listen???????80;
server_name?gd.yjyygywcw.com;
root?/opt/web/gongdan;
charset?utf-8;
location?/?{
index?index.php;
if?(!-e?$request_filename)?{
rewrite?^/index.php(.*)$?/index.php?s=$1?last;
rewrite?^(.*)$?/index.php?s=$1?last;
break;
}
}
location?~?\.php$?{
fastcgi_index?index.php;
include?fastcgi.conf;
fastcgi_pass?127.0.0.1:9000;
set?$path_info?"";
set?$real_script_name?$fastcgi_script_name;
if?($fastcgi_script_name?~?"^(.+?\.php)(/.+)$")?{
set?$real_script_name?$1;
set?$path_info?$2;
}
fastcgi_param?SCRIPT_FILENAME?$document_root$real_script_name;
fastcgi_param?SCRIPT_NAME?$real_script_name;
fastcgi_param?PATH_INFO?$path_info;
}
access_log?/opt/log/nginx/gd.yjyygywcw.com/gd.yjyygywcw.com_access.log?main;
}
核心查看:
if?(!-e?$request_filename)?{
rewrite?^/index.php(.*)$?/index.php?s=$1?last;
rewrite?^(.*)$?/index.php?s=$1?last;
break;
}
總結
以上是生活随笔為你收集整理的phpthink 隐藏index.php,nginx 配置--支持phpthink框架 path_info的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php base64_decode 图片
- 下一篇: 基于php的购物网站源代码,基于PHP的