当前位置: 首页 > Linux

lnmp.org如何改变TP6.0框架的pathinfo方式

时间:2023-04-06 11:49:59 Linux

很多都不能在互联网上工作。折腾了一天,终于试了一下,只需要换一个就可以了。将includeenable-php.conf改为includeenable-php-pathinfo.conf然后lnmprestart这是一键安装后nginx.conf文件的原配置server{listen443ssl;听80默认服务器;#listen[::]:80default_serveripv6only=on;server_name_;#自己写域名索引index.htmlindex.htmindex.php;根/home/wwwroot/默认;#error_page404/404.html;#拒绝访问特定目录中的PHP文件#location~/(wp-content|uploads|wp-includes|images)/.*.php${denyall;}包含enable-php.conf;#Thisiswheretoreplace:更改includeenable-php.conf以包含enable-php-pathinfo。conflocation/nginx_status{stub_statuson;access_log关闭;}location~.*.(gif|jpg|jpeg|png|bmp|swf)${过期30天;}location~.*.(js|css)?${过期12h;}location~/.well-known{允许所有;}位置~/.{全部拒绝;}access_log/home/wwwlogs/access.log;}那么就好了!