thinkphp 去掉URL 里面的index.php
例如你的原路径是 http://localhost/test/index.php/home/goods/index.html
那么现在的地址是 http://localhost/test/home/goods/index.html 如何去掉index.php呢?
1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置 #LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉
2.AllowOverride None 改None改为 All //在APACHE里面去配置 (注意其他地方的AllowOverride也统统设置为ALL)
<Directory "D:/server/apache/cgi-bin"> #AllowOverride none
AllowOverride ALL
Options None
Order allow,deny
Allow from all
</Directory>
3.确保 config.php 里面配置项 URL_MODEL 设置为 2 return Array( 'URL_MODEL' => '2', );
4 .htaccess文件必须放到项目跟目录下 这个文件里面加:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
详细见此文:
http://www.cnblogs.com/summerzi/p/3868566.html
thinkphp 去掉URL 里面的index.php的更多相关文章
- thinkphp 去掉URL 里面的index.php(?s=)
例如你的原路径是 http://localhost/test/index.php/home/goods/index.html 那么现在的地址是 http://localhost/test/home/g ...
- 如何去掉wordpress网站url里面的index.php(Apache服务器)
在wordpress根目录新建.htaccess文件,并拷贝以下代码保存即可. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase ...
- ThinkPHP去掉URL中的index.php
我的环境是apache+ubuntu 1,先确认你有没mod_rewrite.so模块 /usr/lib/apache2/modules/mod_rewrite.so 然后在httpd.conf最后一 ...
- angular 去掉url里面的#
1.适合客户端的方法,但是页面不能刷新,一刷新就404 (1)在index.html里添加 <base href="/"> (2)在app.js的config里,注入$ ...
- ThinkPHP 隐藏URL中的 index.php
去掉 URL 中的 index.php 通常的URL里面含有index.php,为了达到更好的SEO效果可能需要去掉URL里面的index.php ,通过URL重写的方式可以达到这种效果,通常需要服务 ...
- ThinkPHP5 隐藏接口里面的index.php
隐藏index.php 官方介绍是这样的:http://www.kancloud.cn/thinkphp/thinkphp5_quickstart/145250 可以去掉URL地址里面的入口文件ind ...
- CI在nginx环境下去掉url中的index.php
在nginx环境下CI框架默认URL规则访问不了,出现500错误,如: http://blog.php230.com/index.php/keywords 今天在服务器配置CI框架环境时,去除URL中 ...
- ThinkPHP去除url中的index.php
例如你的原路径是 http:.httpd.conf配置文件中加载了mod_rewrite.so模块 .AllowOverride None 讲None改为 All .确保URL_MODEL ...
- ThinkPHP -- 去除URL中的index.php
原路径是 http://localhost/test/index.php/index/add 想获得的地址是 http://localhost/test/index/add 那么如何去掉index.p ...
随机推荐
- 需要了解的几个Java基础点
关键字 native:表示要调用非Java语言写函数,比如用C语言使用JNI实现的接口.比如windows环境的dll文件.举例:Object.hashcode() 位运算 << n:左移 ...
- wireshark开发环境搭建
自己完成了wireshark开发环境的搭建,主要参考资料是wireshark的官方developer-guide.pdf,网址:https://www.wireshark.org/docs/. 现把搭 ...
- 20-----BBS论坛
BBS论坛(二十) 20.1.cms添加轮播图后台逻辑代码完成 (1)apps/models.py from exts import db from datetime import datetime ...
- python spilt()函数的使用方法
Python中的split()函数的用法 Python中有split()和os.path.split()两个函数,具体作用如下:split():拆分字符串.通过指定分隔符对字符串进行切片,并返回分割后 ...
- 转:Android开源项目推荐之「网络请求哪家强」 Android开源项目推荐之「网络请求哪家强」
转载自https://zhuanlan.zhihu.com/p/21879931 1. 原则 本篇说的网络请求专指 http 请求,在选择一个框架之前,我个人有个习惯,就是我喜欢选择专注的库,其实在软 ...
- Python LoggerAdpater类
Logger子类: import logging # create loggermodule_logger = logging.getLogger('spam_application.auxiliar ...
- php用户注册页面利用js进行表单验证
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- netty之==线程模型
1.1 netty线程模型本质遵循了Reactor的基础线程模型,所以得先介绍Reactor模型 1.2 Reactor模型 无论是C++还是Java编写的网络框架,大多数都是基于Reactor模 ...
- 初学者配置第一个spring mvc Demo
1.web.xml的配置 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi= ...
- jenkins构建&发布git托管的VS工程
顺便做个笔记,以防以后再踩坑:笔者用的是jenkins-1.620和git-2.7.2-64-bit.exe,操作系统是win10(本机) jenkins安装完成之后 如果想要配合git完成拉取代码. ...