lnmp启用pathinfo并隐藏index.php
编辑如下区段:
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
第1行改为:
location ~ [^/]\.php
第4行注释掉, 即前面加#
#try_files $uri =404;
去掉第8行的注释8
include pathinfo.conf;
在location ~ [^/]\.php 上面添加区段
location /
{
if (!-e $request_filename)
{
rewrite “^/(.*)$” /index.php last;
}
}
重启Nginx
service nginx restart
严正声明:本站只出售html页面效果模板,不提供任何类型的网站内容数据,模板仅供学习交流使用,不得用于任何商业以及触犯国家法律法规的用途,违者需自行承担全部责任,与本站无以及模板设计作者无关,本站以及模板作者不承担任何连带责任!!!!
关爱邦 | 网站源码程序下载_免费商业源码分享! » lnmp启用pathinfo并隐藏index.php
关爱邦 | 网站源码程序下载_免费商业源码分享! » lnmp启用pathinfo并隐藏index.php