tp官网已经写了 http://doc.thinkphp.cn/manual/hidden_index.html

不生效 重启nginx .问题依旧

kill掉nginx进程  再启动

贴段自己的配置:

server {
listen 80;
server_name url;
root /*/*/*;

#include conf.d/ipFilter.conf;
#access_log /data/logs/$server_name.access.log main;

if ($http_user_agent ~ "DNSPod") {

return 200;

}

try_files $uri $uri/ @rewrite;

#隐藏index.php

location / {

       if (!-e $request_filename) {

rewrite ^(.*)$ /index.php?s=$1 last;
              break;

#pathinfo模式

location ~ \.php {

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

nginx 环境 thinkphp 隐藏index.php的更多相关文章

  1. nginx下Thinkphp 隐藏index.php

    thinkphp config配置: 'URL_MODEL' => '2', //URL模式 nginx rewrite配置: location / { if (!-e $request_fil ...

  2. Nginx配置PATHINFO隐藏index.php

    1.网络来源:http://www.shouce.ren/post/view/id/1529 server {      listen       80;     default_type text/ ...

  3. 修改Nginx配置文件来隐藏index.php

    找到你要修改的域名对应nginx配置文件(vhost下),添加如下代码 location / { if (!-e $request_filename) { rewrite ^(.*)$ /index. ...

  4. nginx下重写隐藏index.php文件

    location / { root /项目目录/; index index.php; if (-f $request_filename/index.php){ rewrite (.*) $1/inde ...

  5. ThinkPHP隐藏index.php出现No input file specified的解决方法

    因为在Fastcgi模式下,php不支持rewrite的目标网址的PATH_INFO的解析 ThinkPHP运行在URL_MODEL=2时,会出现 No input file specified.的情 ...

  6. 【Nginx】Nginx配置REWRITE隐藏index.php

    只需要在server里面加上 if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; }

  7. Nginx配置REWRITE隐藏index.php

    server { listen 80; server_name localhost; root D:\workspace\PHP\Atromic; location / { index index.p ...

  8. 隐藏index.php - ThinkPHP完全开发手册 - 3.1

      为了更好的实现SEO优化,我们需要隐藏URL地址中的index.php,由于不同的服务器环境配置方法区别较大,apache环境下面的配置我们可以参考5.9 URL重写来实现,就不再多说了,这里大概 ...

  9. 【thinkphp 5 在nginx 环境下路由无法生效(404 500错误 )的解决方法】

      非常惭愧的说,由于之前一直使用的是windowservice,安装apache来进行服务器布置的,这种方式也是最简单最直接的方式, 但是由于php的服务大多都是linux栈的,咱们也不能落后呀,在 ...

随机推荐

  1. Android StickyListHeadersListView头部悬停 分组列表实现

    最近在做分组列表,头部悬停的效果,在github上就搜到了StickyListHeaders(https://github.com/emilsjolander/StickyListHeaders)这个 ...

  2. MySQL(四)InnoDB中一棵B+树能存多少行数据

    一.InnoDB一棵B+树可以存放多少行数据?(约2千万) 我们都知道计算机在存储数据的时候,有最小存储单元,这就好比我们今天进行现金的流通最小单位是一毛.在计算机中磁盘存储数据最小单元是扇区,一个扇 ...

  3. mybatis xml动态语句写法

    mapper.java: /** * @Description: 根据摄像机Id查询出入记录 * @Param: * name 姓名 * monitorId 布控ID * starttime 开始时间 ...

  4. kafka生产者消费者

    import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.Co ...

  5. Python random模块(以后用到一个再更新一个)

    random模块是产生随机数的模块 1.random.random() 这是产生0~1之间一个随机浮点数,但是不会包括1 import random num = 0 while num < 10 ...

  6. ELK基础配置

    前言 近期在研究日志系统的设计,感觉现在公司的子系统和接口太多了,日志看不过来,就想着有没有一种方法可以把各个程序的日志组合到一起.于是乎就搜到了ELK.开始对ELK的概念完全搞不懂,就照着各个平台文 ...

  7. Ubuntu下添加定时任务执行php文件

    //添加自动下载定时任务1. vim /etc/crontab2. 添加 #每5分钟执行一次*/5 * * * * root /usr/bin/php /home/wwwroot/123.php3. ...

  8. vue+iview 通过a标签实现文件下载

    vue+iview 通过a标签实现文件下载 方法一: 注意: 如果下载的文件放在本地目录下,一定要将模板文件放到 public 目录下,否则由于权限问题找不到文件 路径: 项目更目录-->pub ...

  9. 定时任务cron表达式详解

    参考自:https://blog.csdn.net/fanrenxiang/article/details/80361582 一 cron表达式 顺序 秒 分 时 日期 月份 星期 年(可选) 取值 ...

  10. 如何理解H264 编码

    H264 结构 https://blog.csdn.net/andywang201001/article/details/80274886 H264 源码  https://www.cnblogs.c ...