OpenLitespeed服务器WordPress的rewrite规则

  

WordPress基本的rewrite规则

1
2
3
4
5
6
7
8
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^/index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

将非https80端口重定向到https 443端口

1
2
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.your-domain.com/$1 [R,L]

将域名重定向到https域名

1
2
RewriteCond %{HTTP_HOST} ^www\.your-domain\.com
RewriteRule (.*) https://your-domain.com/$1 [R=301,L]

注意需要开启rewrite选项
OpenLiteSpeed,rewrite,wordpress,OpenLitespeed服务器WordPress的rewrite规则

最后平滑重启服务器即可

账号密码登录