关于TP框架隐藏index.php
来源:互联网 发布:没卡怎么在淘宝买东西 编辑:程序博客网 时间:2024/06/06 05:58
保证下面这些基础的东西都改掉
1. 确认httpd.conf配置文件中加载了mod_rewrite.so模块
2. AllowOverride None 将None改为 All;允许读取.htaccess文件
3. 打开Myapp/Conf/config.php文件,在配置的数组中添加一行:
'URL_MODEL'=>2,
4. 在入口文件所在的同级目录下,新建一个.htaccess文件,内容是:
1
2
3
4
5
6
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/
$1
[QSA,PT,L]
</IfModule>
1、在.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>
只需要改成这样(只有最后一行有所改变):
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
2、
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
阅读全文
0 0
- 关于TP框架隐藏index.php
- ci框架&tp框架隐藏index.php
- TP框架隐藏index.php和Home的访问名
- CodeIgniter框架隐藏index.php
- 关于ThinkPHP隐藏index.php
- ThinkPHP框架里隐藏index.php
- CI框架 .htaccess 隐藏url中index.php的解决
- 隐藏CI框架路径中的index.php方法
- Debian8环境下thinkphp框架隐藏index.php
- CI框架学习之--隐藏入口文件-index.php
- yii框架 隐藏index.php 以及美化URL
- CI框架 .htaccess 隐藏url在index.php解决方案
- ThinkPHP框架中隐藏index.php无效解决方法
- yii 隐藏index.php
- Yii隐藏index.php
- YII隐藏index.php
- ci 隐藏index.php
- thinkphp 隐藏index.php
- 51获取MPU6050数据并通过匿名上位机显示波形
- vsnprintf用法解析
- 数据结构C语言版赫夫曼树
- closures and variables
- 拓扑排序
- 关于TP框架隐藏index.php
- CentOS7 yum安装mongodb
- 在Kali linux下安装XAMPP并搭建DVWA遇到的问题及解决办法
- itop4412 uboot 学习详细记录(二丶Exynos4412 uboot的组成)
- Codeforces Round #449 (Div. 2) D(思维)
- 【安全牛学习笔记】OWASP_ZAP
- springmvc下的Token设计
- 前端移动端适配方法
- 如何使用Rust提高Ruby性能