TP框架隐藏index.php和Home的访问名
来源:互联网 发布:python日常实用小脚本 编辑:程序博客网 时间:2024/06/15 06:43
首先隐藏index.php
修改配置文件ThinkPHP/Conf/convention.php:
'URL_CASE_INSENSITIVE' => true, // 默认false 表示URL区分大小写 true则表示不区分大小写'URL_MODEL' => 2, // URL访问模式,可选参数0、1、2、3,代表以下四种模式: // 0 (普通模式); 1 (PATHINFO 模式); 2 (REWRITE 模式); 3 (兼容模式) 默认为PATHINFO 模式
然后配置Nginx
location / { try_files $uri $uri/ /index.php?s=$uri&$args;}
意思是:如果第一个
Apache这样配置 ,在根目录新建.htaccess文件:
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]</IfModule>
其次隐藏Home模块
在公共目录下面的Common/Conf/config.php里面配置如下代码实现隐藏Home目录
<?phpreturn array( //'配置项'=>'配置值' 'MODULE_ALLOW_LIST' => array('Home', 'Admin'), 'DEFAULT_MODULE' => 'Home',);
阅读全文
0 0
- TP框架隐藏index.php和Home的访问名
- ci框架&tp框架隐藏index.php
- 关于TP框架隐藏index.php
- thinkphp隐藏index.php/home,并允许访问其他模块
- CodeIgniter框架隐藏index.php
- CI框架 .htaccess 隐藏url中index.php的解决
- thinkphp3.2 隐藏Home模块及index.php入口文件的方法
- PHP http://localhost:63342/untitled1/index.php/Home URL格式访问不到报404 的解决方案
- PHP http://localhost:63342/untitled1/index.php/Home URL格式访问不到报404 的解决方案
- ThinkPHP框架里隐藏index.php
- ci的index.php隐藏
- 隐藏index.php的规则
- tp框架去掉默认module为index的情况
- java---多态--php的框架---tp
- tp框架和laravel框架的区别
- CI框架 .htaccess 隐藏url中index.php的解决(转)
- Yii隐藏index.php文件的步骤
- TP框架中隐藏的预处理函数,前置钩子
- 基于数组的排序算法
- 问答入门----HTML5 / js多线程
- poll服务器
- mysql 查找具体sql执行性能
- KMP算法的时间复杂度
- TP框架隐藏index.php和Home的访问名
- OpenGL GAO访问冲突(glBindVertexArray)
- Hinton Neural Networks for Machine Learning 第二讲: 感知机-几何描述
- python计算两个地址之间的距离
- [POJ]3164 Command Network 朱刘算法
- 关于多维数组的reshape
- GUI--第十四天
- Linux 防火墙iptables (四)iptables NAT(端口映射)
- F