当前位置:首页 » 编程语言 » 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;
}
}

热点内容
android画虚线 发布:2025-07-03 04:11:04 浏览:383
系统启动密码怎么取消 发布:2025-07-03 04:08:06 浏览:745
python程序设计第三版课后答案 发布:2025-07-03 03:58:08 浏览:213
socket上传文件 发布:2025-07-03 03:57:24 浏览:895
安卓cleo脚本 发布:2025-07-03 03:41:26 浏览:245
编程器解读 发布:2025-07-03 03:22:49 浏览:24
中国电信加密通信业务 发布:2025-07-03 03:06:00 浏览:521
脚本家的台词 发布:2025-07-03 03:05:50 浏览:709
arcgisforpython 发布:2025-07-03 03:05:46 浏览:899
期计算法 发布:2025-07-03 02:56:53 浏览:405