我是靠谱客的博主 酷酷小白菜,这篇文章主要介绍thinkphp5.1隐藏index.php入口文件thinkphp5.1隐藏index.php入口文件,现在分享给大家,希望可以做个参考。

thinkphp5.1隐藏index.php入口文件

修改public目录下的,.htaccess文件修改为

复制代码
1
2
3
4
5
6
7
8
9
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>

官方提供的是

复制代码
1
2
3
4
5
6
7
8
9
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>

会提示以下错误
在这里插入图片描述

正确做法,只需要在index.php后加?即可

最后

以上就是酷酷小白菜最近收集整理的关于thinkphp5.1隐藏index.php入口文件thinkphp5.1隐藏index.php入口文件的全部内容,更多相关thinkphp5内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(66)

评论列表共有 0 条评论

立即
投稿
返回
顶部