zoukankan      html  css  js  c++  java
  • nginx下重写隐藏index.php文件

    location / {
    
    
            root   /项目目录/;
            index  index.php;
    
            if (-f $request_filename/index.php){
                    rewrite (.*) $1/index.php;
            }
            if (!-f $request_filename){
                    rewrite (.*) /index.php;
            }
    
           #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则 thinkphp 部署到linux 下常用
              if (!-e $request_filename)
                  {
                        #地址作为将参数rewrite到index.php上。
                        rewrite ^/(.*)$ /index.php/$1;
                        #若是子目录则使用下面这句,将subdir改成目录名称即可。
                        #rewrite ^/subdir/(.*)$ /subdir/index.php/$1;
                  }
    
    
    
    }
  • 相关阅读:
    Linux系统安装
    设计模式的原则
    vue基础
    软考常考题目及解题技巧
    软件设计师
    Wireshark 使用教程
    JVM 调优
    Shell脚本编写
    Linux相关知识
    HTTP缓存机制及原理
  • 原文地址:https://www.cnblogs.com/phper12580/p/10510042.html
Copyright © 2011-2022 走看看