当前位置:首页 » 编程语言 » thinkphp隐藏indexphp

thinkphp隐藏indexphp

发布时间: 2023-09-26 06:26:55

㈠ tp5框架index.php入口文件隐藏

一,找到/public/.htaccess文件,如果你的入口文件已经移动到根目录下,那么你的.htaccess文件也要剪切到根目录下,总之要确保.htaccess跟入口的index.php保持同级。
二,根据你的php环境分别设置.htaccess文件:
Apache:
<IfMole mod_rewrite.c>Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]</IfMole>

phpstudy:
<IfMole mod_rewrite.c> Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfMole>
Nginx(在Nginx.conf中添加):
location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}

热点内容
绝地求生和赛博朋克2077哪个吃配置 发布:2025-09-18 11:35:20 浏览:164
亚索脚本秒风 发布:2025-09-18 11:35:07 浏览:432
sql表的复制 发布:2025-09-18 11:02:25 浏览:67
三位密码锁忘记密码如何重置 发布:2025-09-18 10:21:52 浏览:186
linux怎么编译c文件 发布:2025-09-18 09:55:16 浏览:305
python安装后无法运行 发布:2025-09-18 09:45:57 浏览:239
安卓手机怎么剪辑音乐 发布:2025-09-18 09:44:16 浏览:784
服务器地址修改在哪找 发布:2025-09-18 09:42:41 浏览:444
sntp服务器地址 发布:2025-09-18 09:28:36 浏览:555
phpunit 发布:2025-09-18 09:25:19 浏览:573