在网站的Nginx配置文件的
{ }位置之间添加如下代码,并重启Nginx
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
进入网站文件夹,编辑.htaccess,添加/编辑如下代码,并重启apache或litespeed
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/index\.php$ - [L] # 就是在^ index\.php$ 加 /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>