nginx去掉index.php 只需2个步骤。
来源:互联网 发布:软件项目管理方法 编辑:程序博客网 时间:2024/05/29 17:23
为了使URL更简洁优雅些,我们可以通过Nginx的rewrite规则把index.php去掉。
Thinkphp 框架如果有数据分页的页面需要修改入口文件
//nginx环境下防止U方法输出错误
define('__APP__', ''); //在入口文件index.php中添加这一句
第一步:要编辑子站的配置文件
vi /usr/local/nginx/conf/vhost/子站.conf
把 include enable-php.conf 注释掉这行!(或者直接dd删除)
然后在下面新曾一行 添加
include enable-php-pathinfo.conf; #注意后面必须带分号
第二步:
cd /usr/local/nginx/conf/vhost/子站.conf
vi 子站.conf 在你的虚拟主机配置文件server段里添加以下内容:
location / {
}
完成!
结果:http://localhost/Home/Index/mod 访问正常!
阅读全文
0 0
- nginx去掉index.php 只需2个步骤。
- nginx去掉index.php
- nginx 重写去掉index.php
- nginx 重写去掉index.php
- nginx去掉index.html改为index.php
- Nginx/PHP/path_info问题,去掉index.php
- nginx去掉url中的index.php
- nginx去掉url中的index.php
- ecstore nginx下去掉index.php入口文件
- CI在nginx环境下去掉url中的index.php
- ThinkPHP 在nginx环境下去掉URL中的index.php
- nginx支持ssl和panthinfo和去掉index.php
- CI去掉index.php
- CI去掉index.php
- CodeIgniter 去掉index.php
- thinkphp去掉index.php
- CodeIgniter 去掉index.php
- CI去掉index.php
- cache 强缓存 协商缓存
- javascript 进阶
- LightOJ 1038 Race to 1 Again(概率期望)
- DS:对称矩阵
- Vessels CodeForces
- nginx去掉index.php 只需2个步骤。
- 学习系列-DLL
- Java swing 仿QQ实现系统托盘图标(下)
- C++ 二级指针的理解
- [数论] LOJ #508. 「LibreOJ NOI Round #1」失控的未来交通工具
- Spring Aop基础
- 堆的使用,自己确定数组的大小和值,然后求和
- DOM编程-节点操作(一)
- Javascript中获取数组最大值和最小值以及最大值和最小值的下标 没学对象前的最简单最基本的方法