在index.php 的同级目录下新建 .htaccess 文件

<IfModule mod_rewrite.c>

 Options +FollowSymlinks -Multiviews
 RewriteEngine On


 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

 RewriteCond %{SERVER_PORT} !^443$
 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
 
</IfModule>