ThinkPHP5在phpStudy下无法隐藏index.php的解决方法
对于我们新生学习thinkphp5的时候会遇到TP5在phpStudy安装的环境里无法隐藏index.php.
按照ThinkPHP5官方完全开发手册里的提供的修改httpd.conf配置文件和.htaccess文件后,还是不能达到隐藏index.php的效果。
下面提供的thinkphp的官方方法:

下面是访问问题:


后来查了很多资料后才发现,只要再修改.htaccess文件就可以完全解决这个无法隐藏index.php的问题
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
修改后再访问就正常了

相关推荐
-
PHP8种变量类型的详细讲解2025-02-22 00:32:24
-
php+apache 和 php+nginx的区别2025-02-22 00:21:27
-
PHP:与workerman结合实现定时任务2025-02-22 00:15:57
-
Nginx的Rewrite规则与实例2025-02-22 00:15:39
-
MySql中身份证字段的简单脱敏介绍2025-02-22 00:15:36