nginx去掉url中的index.php
2014-07-13 14:00
423 查看
使用情境:我想输入www.abc.com/a/1后,实际上是跳转到www.abc.com/index.php/a/1
配置Nginx.conf在你的虚拟主机下添加:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
}
}
如果你的项目入口文件在一个子目录内,则:
location /目录/ {
if (!-e $request_filename){
rewrite ^/目录/(.*)$ /目录/index.php/$1 last;
}
}
配置Nginx.conf在你的虚拟主机下添加:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
}
}
如果你的项目入口文件在一个子目录内,则:
location /目录/ {
if (!-e $request_filename){
rewrite ^/目录/(.*)$ /目录/index.php/$1 last;
}
}
相关文章推荐
- 在nginx下去掉ci框架url中的index.php
- nginx服务器去掉url中的index.php 和 配置path_info
- ThinkPHP 在nginx环境下去掉URL中的index.php
- nginx去掉url中的index.php
- CI在nginx环境下去掉url中的index.php
- nginx去掉url中的index.php
- ThinkPHP 在nginx环境下去掉URL中的index.php
- ThinkPHP 在nginx环境下去掉URL中的index.php
- CI框架apache和nginx环境下面统一去掉路径URL后面的index.php
- ThinkPHP 在nginx环境下去掉URL中的index.php
- CodeIgniter的URL去掉index.php
- 去掉CodeIgniter URL中的index.php
- nginx去掉index.php
- 去掉CodeIgniter URL中的index.php
- CodeIgniter 去掉/去除/删除 URL中index.php 的方法
- url中去掉index.php
- 去掉php框架CI默认url中的index.php
- 去掉CodeIgniter URL中的index.php
- ThinkPHP-URL中去掉index.php