当前位置:网站首页>Thinkphp5 how to hide index PHP entry file
Thinkphp5 how to hide index PHP entry file
2022-04-22 06:16:00 【sinat_ twenty-nine million three hundred and twenty-six thousan】
thinkphp current php One of the main frameworks , This article introduces thinkphp5.0 How to hide index.php Entrance file , In fact, it is to remove URL In the address bar index.php, Make our url It looks more beautiful .
see thinkphp5.0 Hidden development manual index.php Entrance file
Actually thinkphp5 The development manual has given the method , But through personal experience, I found that the official method seems to be a little wrong .
According to the manual , I opened it first apache Of http.conf The configuration file , And found mod_rewrite.so The words... .
Find out mod_rewrite.so There is no #, That is to say, it is on , No need to change .

The second step ,AllowOverride None take None Change it to All
I'll search first AllowOverride None Found two , I'm not sure which one, so I didn't change it .(PS: In the end, it seems that this step is redundant , It's not what it takes. )
The third step , modify .htaccess Configuration content
This file is in thinkphp5 Next public Under the table of contents , use sublimetext Editor or Notepad++ open , I changed it according to the manual , I can't find out !
<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>
The above is provided in the manual , But after the change, I found it impossible !
But just replace the last sentence with the following , Successfully hide index.php Entrance file .
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
版权声明
本文为[sinat_ twenty-nine million three hundred and twenty-six thousan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220548094975.html
边栏推荐
猜你喜欢
随机推荐
ldap 验证 页面管理
Jeecgboot development experience process
Re transfer form to JSON
蚂蚁s19xp,参数功耗首发
el-input-number 如何设置初始值为空
Solve the dislocation problem of El table scroll bar (perfect level)
解决js计算精度问题
调用接口,获取时间
数据总线bus实现兄弟组件之间的通信
IPI中断
pip freeze 导出含有路径 (@ file:///) 问题小记
php 月份相差
茉莉X4-1U刀片算力服务器评测
String类intern()方法解析
Failed to execute ‘insertBefore‘ on ‘Node‘: The node before which the new node is to ...报错
如果你频繁需要切换目录的话
Thread content learning
Grafana InfluxDB 简单脚本
switch和if的简单基本使用
laravel【视图】









