1.去掉index.php
2.强制301跳转到https
3.将带www域名的301跳转至不带www域名
4.访问域名/index.php后301跳转到主域名。

<IfModule mod_rewrite.c>
RewriteEngine On
#伪静态
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,E=PATH_INFO:$1]
#强制跳转https
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://chujian.xyz/$1 [L,R=301]
#带www的跳转至不带www域名
RewriteCond %{HTTP_HOST} !^chujian.xyz$ [NC]
RewriteRule ^(.*)$ http://chujian.xyz/$1 [L,R=301]
#index.php跳转
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://chujian.xyz/ [R=301,L]
</IfModule>

作者:https://zhebk.cn/Web/htaccess.html

:D 少女祈祷中...