数智学习中心 计科随机库
学习专区 Linux专栏 博客圈 计科之路 登录
Nginx 重定向 伪静态 rewrite index.php

Nginx 重定向 伪静态 rewrite index.php

thinkphp入口文件同目录下添加。把下面的内容保存为.htaccess文件

Options +FollowSymlinks -Multiviews

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php?/$1 QSA,PT,L

在http{ server{ }}里写代码,在原来那些location附近写

location / {
                if (!-e $request_filename){
                        rewrite ^/(.*)$ /index.php/$1 last;
                 }
        }

重启

评论留言

一共0条留言