thinkphp的使用——隐藏index.php
官方默认的。htaccess文件
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
如果用的是phpstudy
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
Nginx环境,可以在Nginx.conf
location /{//..... 省略了部分代码
if!(!-e $request_filename){
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
thinkphp的使用——隐藏index.php的更多相关文章
- ThinkPHP 下如何隐藏index.php
最近一直在做孕妈团的项目,因为部署到实际项目中出现了链接打不开的情况,要默认添加index.php才能正常访问. 当时忘了是Tinkphp的URL重写模式:以后遇到相同问题,首先要想到URL重写模式. ...
- ThinkPHP框架里隐藏index.php
本文所写的配置在ThinkPHP3.2.2上测试过.按理也兼容其它版本. 首先修改配置文件: 'URL_CASE_INSENSITIVE' => true, // 默认false 表示URL区分 ...
- nginx 环境 thinkphp 隐藏index.php
tp官网已经写了 http://doc.thinkphp.cn/manual/hidden_index.html 不生效 重启nginx .问题依旧 kill掉nginx进程 再启动 贴段自己的配置 ...
- thinkphp中redirect重定向后隐藏index.php
首先,.htaccess文件要配置好隐藏index.php.系统默认生成的就行. 然后,也是最关键的一部,要在Application/Home/Conf里的config.php文件中增加如下配置: & ...
- ThinkPHP CI codeignitor 框架 apache 重写 url 隐藏index.php 服务器 报错:Object not found! 可能是.htaccess隐藏index.php
隐藏index.php可以去掉URL地址里面的入口文件index.php,但是需要额外配置WEB服务器的重写规则.以Apache为例,需要在入口文件的同级添加.htaccess文件(官方默认自带了该文 ...
- ThinkPHP路由去掉隐藏URL中的index.php
官方默认的.htaccess文件 <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On ...
- TPshop隐藏index.php
有些朋友提到关于TPshop 隐藏index.php 一问题, 可以修改 Application\Common\Conf\config.php 文件代码 'common', 'AUTH_CODE' = ...
- url优化|隐藏index.php
隐藏index.php 一.codeigniter codeigniter和许多php框架一样,有个单一入口index.php,从url上看,显得很不友好.通过apache的rewirte,是可以 ...
- CI 框架隐藏index.php-ubuntu
和朋友在做一个小网站,用到了CI框架,之前测试都是在windows上,隐藏index.php也相对比较简单.但服务器是ubuntu系统,需要配置一下,根据网上看到的一些教程,结合自己电脑的特点,记录步 ...
随机推荐
- Unite 2017 干货整理 优化篇
Unite 2017 干货整理 优化篇 2017年05月16日 将Unite 2017的一些演讲做了整理. 本篇有内存,CPU.GC.UI.渲染性能指标.Tips几个小节. 内容持续整理中. 内存 ...
- IT兄弟连 JavaWeb教程 过滤器与监听器经典面试题
1.谈谈你对Servlet过滤器的理解 过滤器是Servlet2.3规范中定义的一种小型的.可插入的Web组件.用来拦截Servlet容器的请求和响应过程,以便查看.提取客户端和服务器之间正在交换的数 ...
- pytest框架(二)
一.示例代码一 D:YOYO\ __init__.py test_class.py # content of test_class.py class TestClass: def test_one(s ...
- Glassfish 4 修改server.log 等配置
如果所示:
- 常见的div布局面试题
题目1:如何让一个子元素在父元素里水平垂直居中? 方法1 .box{width:400px;height:400px;background:#ccc;position:relative;} .chil ...
- C# ExpandoObject用法
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...
- QDU-GZS与素数大法(素数筛法)
Description 自从GZS成为G神之后,追随者不计其数,更是有了大名鼎鼎的拜神论: "吾尝终日编程也,不如须臾之拜拜G神也:吾尝打字刷题也,不如一日三拜G神也: 拜拜G神,程序非长也 ...
- Spring boot中应用jpa jpa用法
https://blog.csdn.net/u012582402/article/details/78717705
- 泛型设计<T, PK extends Serializable>
泛型类和泛型方法的使用 http://www.jb51.net/article/67445.htm http://www.cnblogs.com/iyangyuan/archive/2013/04/0 ...
- qt QMessageBox 中文乱码的问题
QMessageBox::information(this,"Warn", "请插入U盘"); ==================> QMessageB ...