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 ...
随机推荐
- 阻塞队列 BlockingQueue 详解
转自:https://mp.weixin.qq.com/s?__biz=MzI4Njc5NjM1NQ==&mid=2247487078&idx=2&sn=315f39b6d53 ...
- linux服务器架设--学习笔记
PS: Centos是属于红帽子的操作系统
- PythonStudy——数据类型转化 Data type conversion
类型转换 1.数字类型:int() | bool() | float() 2.str与int:int('10') | int('-10') | int('0') | float('-.5') | fl ...
- ROS下利用realsense采集RGBD图像合成点云
摘要:在ROS kinetic下,利用realsense D435深度相机采集校准的RGBD图片,合成点云,在rviz中查看点云,最后保存成pcd文件. 一. 各种bug 代码编译成功后,打开rviz ...
- tomcat的 tomcat-user.xml
http://blog.csdn.net/asdeak/article/details/1879284 很多个tomcat因为在缺少 " <role rolename="m ...
- linux 磁盘 扩展分区
- Xamarin+Prism开发详解七:Plugin开发与打包测试
有了上章[Xamarin+Prism开发详解六:DependencyService与IPlatformInitializer的关系]的基础,现在来理解Plugin开发就简单了. 本文实例代码地址:ht ...
- pyhton3.5将汉字转成二进制的方法
直接上代码:name = "你好,中国人"byteName = bytes(name.encode("utf-8"))print(byteName)for b ...
- PAT 甲级 1041 Be Unique (20 分)
1041 Be Unique (20 分) Being unique is so important to people on Mars that even their lottery is desi ...
- Linux(CentOS-7) 下载 解压 安装 redis 操作的一些基本命令
使用xshell 连接到虚拟机,并且创建 一个redis目录:创建文件命令:mkdir 文件名ls:查看当前文件里面的所有文件 使用xftp 将下载的linux版本 reids上传动新建的redis目 ...