注意使用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 模式的更多相关文章

  1. nginx配置使其支持thinkphp的pathinfo模式

    #user root;#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log noti ...

  2. Nginx下支持ThinkPHP的Pathinfo和URl Rewrite模式

    下面介绍如何使Nginx支持ThinkPHP的Pathinfo和URL Rewrite模式. 1.ThinkPHP给出了ThinkPHP的官方解决方案,如下: 打开Nginx的配置文件 /etc/ng ...

  3. thinkphp nginx pathinfo模式支持

    最近一个项目中使用了ThinkPHP做为开发框架,URL上我们使用了PATHINFO模式,但是Nginx默认是不支持PATHINFO的,需要进行手动配置才可以,于是我们按照了以下方法进行了Nginx的 ...

  4. ThinkPHP中pathinfo模式与URL重写

    Thinkphp中的pathinfo模式 http://serverName/appName/module/action/id/1/ pathinfo模式 在不考虑路由的情况下,第一个参数会被解析成模 ...

  5. ThinkPHP中PATHINFO模式优化

    ThinkPHP 3.1.2官方手册 第16.2章节 <隐藏index.php>中提到在Ngnix中隐藏index.php实现SEO友好的方法,其中使用了如下的代码 location / ...

  6. 配置nginx1.8支持thinkPHP3.2 pathinfo模式

    nginx 下conf/nginx.conf 或者自己的vhosts更改以前的参数 location / { root   html; index  index.html index.htm inde ...

  7. Ubuntu配置Nginx虚拟主机和支持ThinkPHP

    [Nginx配置虚拟主机] 每一个 server { listen       80;         server_name  www.a.com; ..... } 就表示一台虚拟域名, 然后对应的 ...

  8. nginx支持url的PATHINFO

    fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; fastcgi_param PATH_INF ...

  9. Nginx下配置ThinkPHP的URL Rewrite模式和pathinfo模式支持

    前面有关于lnmp环境的搭建,在此就不在赘述.下面就简述thinkPHP如何在nginx下开启url_rewrite和pathinfo模式支持 主要有两个步骤: 一.更改php.ini将;cgi.fi ...

随机推荐

  1. web roadmap

  2. linux下的$0-n作用

    电面的时候回答上来一部分了....呵呵......总结一下!!! $0 Shell本身的文件名 $1-$n 添加到Shell的各参数值.$1是第1参数.$2是第2参数… $$ Shell本身的PID( ...

  3. Tex_Err:缺失wlscirep.cls

    使用期刊模板编译时,需要'.cls'一类格式文件支持.从Overleaf上直接Copy代码到本地,发现自己的tex运行时会报错: ! LaTeX Error: File `wlscirep.cls' ...

  4. day 06 字符串和列表的方法

    一.整形int 定义方式: age=18    #调用age=int(18)的方法,自动调用 n=int("123") #只能转换纯数字类型 二:浮点型float 定义方式 sal ...

  5. webapp js与安卓,ios怎么交互

    ) } } export default { callhandler (name, data, callback) { setupWebViewJavascriptBridge(function (b ...

  6. 100道Java基础面试题收集整理(附答案)

    不积跬步无以至千里,这里会不断收集和更新Java基础相关的面试题,目前已收集100题. 1.什么是B/S架构?什么是C/S架构 B/S(Browser/Server),浏览器/服务器程序 C/S(Cl ...

  7. 2018.5.2 file结构体

    f_flags,File Status Flag f_pos,表示当前读写位置 f_count,表示引用计数(Reference Count): dup.fork等系统调用会导致多个文件描述符指向同一 ...

  8. python 使用gevent模块实现手动挡切换多协程。

    from greenlet import greenlet def test1(): print(12) g2.switch()#切换到协程g2执行,保存执行状态 print(23) g2.switc ...

  9. 664. Strange Printer

    class Solution { public: int dp[100][100]; int dfs(const string &s, int i,int j) { if(i>j)ret ...

  10. python中的列表的嵌套与转换

    第一种方法:这行代码的for循环的意识,是先将matrix列表中的每行的第一个元素拿出. matrix =[[1,2,3,4],[5,6,7,8],[9,10,11,12]] transposed_r ...