700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > nginx下Thinkphp 隐藏index.php

nginx下Thinkphp 隐藏index.php

时间:2023-01-09 20:52:16

相关推荐

nginx下Thinkphp 隐藏index.php

thinkphp config配置:

'URL_MODEL'=> '2', //URL模式

nginx rewrite配置:

location / { if (!-e $request_filename) {rewrite ^(.*)$ /index.php?s=$1 last;break;}}

如果你的ThinkPHP安装在二级目录,Nginx的伪静态方法设置如下,其中domainname是所在的目录名称

location /domainname/ {if (!-e $request_filename){rewrite ^/domainname/(.*)$ /domainname/index.php?s=$1 last;}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。