宝塔面板搭建thinkphp后请求中去除index.php后缀
nginx配置
-
在宝塔面板
网站中绑定thinkphp的public,添加站点 -
点击站点
设置按钮打开项目设置页面 -
找到
配置文件选项,然后在22行后添加一下代码location / { if (!-f $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } } -
重启服务
图例:

Apache配置
- 在
public下新建.htaccess文件 - 填充内容
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>
3.重启项目
图例:












![[Eigen中文文档] 稠密矩阵分解函数对比](https://img-blog.csdnimg.cn/281b570fcc6542c18cf73cf1ad3151fe.png#pic_center)







