LNMP 支持 ThinkPHP 的 pathinfo 模式
注意使用LNMP 1.4版
1、修改php.ini 启用pathinfo
/usr/local/php/etc/php.ini
cgi.fix_pathinfo = 0 值改为1
2、修改/usr/local/nginx/conf/vhost/你的网站.conf 配置文件
include enable-php.conf; 替换为 include enable-php-pathinfo.conf;
注意包含thinkphp.conf的路由配置文件
配置文件如下所示:
server
{
listen 80;
#listen [::]:80;
server_name www.abc.com ;
index index.html index.htm index.php default.html default.htm default.php;
root /www/abc;
include thinkphp.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php-pathinfo.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/www.abc.com.log;
}
LNMP 支持 ThinkPHP 的 pathinfo 模式的更多相关文章
- nginx配置使其支持thinkphp的pathinfo模式
#user root;#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log noti ...
- Nginx下支持ThinkPHP的Pathinfo和URl Rewrite模式
下面介绍如何使Nginx支持ThinkPHP的Pathinfo和URL Rewrite模式. 1.ThinkPHP给出了ThinkPHP的官方解决方案,如下: 打开Nginx的配置文件 /etc/ng ...
- thinkphp nginx pathinfo模式支持
最近一个项目中使用了ThinkPHP做为开发框架,URL上我们使用了PATHINFO模式,但是Nginx默认是不支持PATHINFO的,需要进行手动配置才可以,于是我们按照了以下方法进行了Nginx的 ...
- ThinkPHP中pathinfo模式与URL重写
Thinkphp中的pathinfo模式 http://serverName/appName/module/action/id/1/ pathinfo模式 在不考虑路由的情况下,第一个参数会被解析成模 ...
- ThinkPHP中PATHINFO模式优化
ThinkPHP 3.1.2官方手册 第16.2章节 <隐藏index.php>中提到在Ngnix中隐藏index.php实现SEO友好的方法,其中使用了如下的代码 location / ...
- 配置nginx1.8支持thinkPHP3.2 pathinfo模式
nginx 下conf/nginx.conf 或者自己的vhosts更改以前的参数 location / { root html; index index.html index.htm inde ...
- Ubuntu配置Nginx虚拟主机和支持ThinkPHP
[Nginx配置虚拟主机] 每一个 server { listen 80; server_name www.a.com; ..... } 就表示一台虚拟域名, 然后对应的 ...
- nginx支持url的PATHINFO
fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; fastcgi_param PATH_INF ...
- Nginx下配置ThinkPHP的URL Rewrite模式和pathinfo模式支持
前面有关于lnmp环境的搭建,在此就不在赘述.下面就简述thinkPHP如何在nginx下开启url_rewrite和pathinfo模式支持 主要有两个步骤: 一.更改php.ini将;cgi.fi ...
随机推荐
- python基础12_匿名_内置函数
一个二分查找的示例: # 二分查找 示例 data = [1, 3, 6, 7, 9, 12, 14, 16, 17, 18, 20, 21, 22, 23, 30, 32, 33, 35, 36, ...
- cut语法2
linux每日一命令--cut--按文件大小排序 显示前100行 显示后五列 ll -Sh|head -n 100|cut -d ' ' -f 5- 一.基本语法cut是一个选取命令,以行为单位,用指 ...
- hdu 6241 Color a Tree 2017 CCPC 哈理工站 L
Bob intends to color the nodes of a tree with a pen. The tree consists of NN nodes. These nodes are ...
- 让你简洁清晰真正的了解什么是JavaSCript
学习JavaScript高级程序设计第三版第一步.JavaScript简介不光在这一本说介绍,很多书都提及到,我就简单的把重点记录下来,当做整理吧,以便自己及大家观看. 1995年,我出生了,Java ...
- list基本代码
#include<iostream> #include<list> //STL之list的基本用法 using namespace std; void outputList(l ...
- 重读 谢希仁《计算机网络》3 - 网络层和IP协议
- Python2和Python3关于reload()用法的区别
Python2 中可以直接使用reload(module)重载模块. Pyhton3中需要使用如下两种方式: 方式(1) >>> from imp >>> imp. ...
- php 会话控制(关于session的维护与生命周期)
Session是由应用服务器维持的一个服务器端的存储空间,用户在连接服务器时,会由服务器创建生成一个唯一的sessionID,用该sessionID为标识符来存取服务器端的Session存储空间,在会 ...
- Linux双线双网卡双IP双网关设置方法
机房上架了一台测试机,系统是Ubuntu 9.04 X64的系统,母机IBM X336机器.用户需求是双线,故采用一个网卡配置电信地址,另一个网卡配置联通地址,安装好系统后配置好IP发现联通地址和电信 ...
- lua luv分析
地址 https://github.com/richardhundt/luv