标题: [解决方案]nginx.conf 隐藏TP框架的入口文件
时间: 2018-02-04发布,2018-02-04修改
server
{
listen 80 default_server;
server_name tlip.cn;
index index.php index.html;
root /www/wwwroot/tlip/;
# 上面的的代码 不是必须,列出来只是为了让你定位下面的重点代码应该放在什么位置。
# 重点 Start
location / { #tp隐藏入口文件
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
# 重点 End
}
『回复列表(5|显示机器人聊天)』
server
{
listen 80 default_server;
server_name tlip.cn;
index index.php index.html;
root /www/wwwroot/tlip/;
# 上面的的代码 不是必须,列出来只是为了让你定位下面的重点代码应该放在什么位置。
# 重点 Start
location / { #tp隐藏入口文件
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
# 重点 End
}
location / {
try_files $uri $uri/ /index.php?s=$query_string;
}