在很多网站中,我们一般都不想显示index.php,有时甚至加了index.php导致跳转错误等问题,那么如何解决呢?
解决方法:(以nginx为例)
PHPstudy(小皮)配置ngnix,使其访问不需要添加index.php
在设置=》vhosts.conf中选择你要改的站点,进入配置文件
只需要在其中加上这段即可
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
apache方式
ThinkPHP5配置隐藏入口index.php文件,Apache/phpstudy - code练习生 - 博客园
原文链接:https://blog.csdn.net/weixin_44052462/article/details/116048039