
初始url样式:http://localhost/tp5/public/index.php/index
1、将 index.php 和 .htacess 文件移出到和Public 文件平级目录;
2、修改 index.php
namespace think;
// 加载基础文件
require __DIR__ . '/thinkphp/base.php';
// 支持事先使用静态方法设置Request对象和Config对象
// 执行应用并响应
Container::get('app')->run()->send();3、修改 .htaccess 文件
虚拟主机或在自备服务器中开设好的主机空间,主机环境要求:PHP4.3-5.x/非安全模式/允许WEB文件上传MYSQL4.2-5.xzend optimizer 3.2以上安装方法:1、将安装包解压后,将全部文件和目录上传到网站空间根目录, 用FTP上传时必须采用二进制方式。2、运行http://您的域名/(安装向导),或者进入网站安装http://您的域名/base/install/,填写MYS
0
立即学习“PHP免费学习笔记(深入)”;
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
</IfModule>最终url样式:http://localhost/tp5/index
推荐教程:《TP5》
以上就是thinkphp中隐藏入口文件的方法的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号