nginx去掉inde.php方法

/**
 * 打开nginx配置文件nginx.conf,添加以下内容
 * 注意层级,在 http{ server { location { #这里添加 } } } 添加
 */
location / {
    if (!-e $request_filename){
        rewrite ^/(.*)$ /index.php/$1 last;
    }

// 或者使用下面的代码
try_files $uri $uri/ /index.php?$query_string; }

 

posted @ 2021-02-14 22:59  孤舟残月浅笑嫣然  阅读(323)  评论(0编辑  收藏  举报