zl程序教程

您现在的位置是:首页 >  其他

当前栏目

ThinkPHP 伪静态配置

2023-02-19 12:20:09 时间

1. ThinkPhP6.0 Apache


TP6.0 官方文档: https://www.kancloud.cn/manual/thinkphp6_0/1037488

Apache (框架默认自带的)

<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>

在 PhpStudy 中的 Apache Url重写文件需要在 index.php 后加 ?

<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>

2. ThinkPhP6.0 Nginx


宝塔Nginx