ThinkPHP去除url中的index.php以及绑定模块
来源:互联网 发布:mac qq离线发送 编辑:程序博客网 时间:2024/05/27 08:13
例如你的原路径是 http://localhost/index.php/home/index/index
你想要的访问的地址是 http://localhost/home/index/index
也就是去除index.php,方法如下:
1.httpd.conf配置文件中加载mod_rewrite.so模块 //在APACHE里面去配置
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉
2.AllowOverride None 将None改为 All //在APACHE里面去配置
AllowOverride none 改 AllowOverride ALL(包括httpd.conf 和 httpd_vhost.conf中的)
Options None
Order allow,deny
Allow from all
3.确保URL_MODEL设置为2,(ThinkPHP/Conf/convention.php 第136行)
'URL_MODEL' => '2',
);
4 .htaccess文件必须放到跟目录下
这个文件里面加:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
5.重启wamp
绑定模块
原地址: http://localhost/home/index/index
现地址: http://localhost/index/index
入口文件中添加define('BIND_MODULE','Admin');
0 0
- ThinkPHP去除url中的index.php以及绑定模块
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php
- thinkphp 如何去除url中的index.php
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php
- ThinkPHP去除url中的index.php,绝对管用!
- 修改apache配置文件去除thinkphp url中的index.php
- ThinkPHP去除url中的index.php 之设置WAMP
- 修改apache配置文件去除thinkphp url中的index.php
- ThinkPHP去除url中的index.php 之设置WAMP
- ThinkPHP URL中去除index.php
- ThinkPHP去掉URL中的index.php
- thinkPHP如何去掉url中的index.php
- hdu2819二分图匹配
- 六个月学会任何一门外语
- CodeForces 609 C. Load Balancing(水~)
- linux命令之ls
- 沙盒与数据库
- ThinkPHP去除url中的index.php以及绑定模块
- 构建黄金组合LVS + Keepalived高可用负载均衡集群
- 【Usaco2015 JAN】Moovie Mooving 题解
- JSP/Servlet认识
- Java中的final
- Cpp_成员指针
- leetcode 22. Generate Parentheses
- [LeetCode]15 三者之和
- python在windows和linux系统下使用virtualenv环境