nginx下pathinfo模式
来源:互联网 发布:网络新词汇大全 编辑:程序博客网 时间:2024/05/29 12:28
最近在一台装了nginx服务器环境下,配置thinkphp,然后pathinfo模式无法使用。查了很多资料,终于处理处理OK了。
1、首先 find / -name nginx.conf
2、找到后 vi nginx.conf
然后 注释掉 php-enable.conf
#include php-enable.conf
include enable-php-pathinfo.conf
3、然后再添加上
//实例如下location / { if (!-e $request_filename){ rewrite ^/$ /index.php; rewrite ^/(.*)$ /index.php?s=$1 last; } }
最后保存重启即可。我用的是lnmp一键包, 直接lnmp nginx restart, OK
http://10.61.193.10/tpshen/index.php/home
4、如果想省略index.php (你的项目在二级目录)则
location /youdomain/ { if (!-e $request_filename){ rewrite ^/youdomain/(.*)$ /youdomain/index.php?s=$1 last; }}
然后就可以 http://10.61.193.10/tpshen/home
阅读全文
0 0
- nginx下pathinfo模式
- nginx下开启pathinfo模式
- Nginx 支持pathinfo模式
- Nginx支持pathinfo模式
- nginx支持pathinfo模式
- nginx配置pathinfo模式
- Nginx服务器下使用ThinkPHP的pathinfo模式的问题
- Nginx下使Thinkphp URL模式支持PATHINFO和REWRITE
- Nginx下使Thinkphp URL模式支持PATHINFO和REWRITE
- 配置nginx支持pathinfo模式
- 配置nginx支持pathinfo模式
- nginx搭建pathinfo模式支持
- 配置nginx支持PATHINFO模式
- 配置Nginx支持pathinfo模式
- Nginx服务器支持pathinfo模式
- Nginx服务器下使Thinkphp URL模式支持PATHINFO模式和REWRITE模式
- 设置 nginx 支持 thinkPHP 的 pathinfo 模式
- Nginx上ThinkPHP的PATHINFO模式支持
- Android O(8.0)后台service限制
- git stash — 暂存临时代码
- JAVA方法访问修饰和类的成员访问修饰
- 第十周【项目1
- tab 指令无法补全,ros ubuntu
- nginx下pathinfo模式
- spark submit参数及调优
- HAProxy介绍
- c++学习笔记--拷贝控制的三/五法则
- java使用session和cookie
- 微信小程序支付(java后端)
- jQuery遍历-祖先
- 第十周项目1(1)-层次遍历算法的验证
- 博客目录