thinkPHP5.0 URL重写文档https://www.kancloud.cn/manual/thinkphp5/177576
postman下载地址https://www.postman.com/downloads/
官方的Apache伪静态
Options +FollowSymlinks -MultiviewsRewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
可以看到index.php?
后面少了一个s=
,但是官方的Nginx伪静态中是有s=
的,上面这个伪静态平时没有影响,但是获取所有参数会多出来一个参数,如下图
但是用下面的伪静态却没有问题,如下图
namespace app\index\controller;use think\Controller;use think\Db;class Index extends Controller{public function test(){dump(input());}}?>
Apache伪静态
这个伪静态参考了宝塔的Apache thinkPHP伪静态
Options +FollowSymlinks -Multiviews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
Nginx伪静态
if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break;}
来源地址:https://blog.csdn.net/qq_19716091/article/details/129390873