跳转到内容

WordPress 迁移

LiteHTTPD 在安装了 19 个流行插件的情况下,通过了全部 18 项 WordPress 兼容性测试:

  • All-In-One Security (AIOS)
  • Wordfence Security
  • W3 Total Cache
  • WP Super Cache
  • Yoast SEO
  • Rank Math SEO
  • Redirection
  • Really Simple SSL
  • HTTP Headers
  • WebP Express
  • EWWW Image Optimizer
  • Imagify
  • Far Future Expiry Header
  • WP Hide & Security Enhancer
  • LiteSpeed Cache

默认的 WordPress .htaccess 无需修改即可工作:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

WordPress 插件通常会在 .htaccess 中添加以下类型的规则:

插件类型使用的指令
安全(AIOS、Wordfence)<FilesMatch>, Require, Order/Deny, <Files>
缓存(W3TC、WPSC)ExpiresByType, Header set Cache-Control, AddType
SEO(Yoast、Rank Math)Redirect, RewriteRule
SSL(Really Simple SSL)RewriteCond %{HTTPS}, RewriteRule [R=301]
图片(WebP Express)RewriteCond %{HTTP_ACCEPT}, AddType

以上所有指令均被 LiteHTTPD 完全支持。

在 .htaccess 中设置 WordPress 特定的 PHP 配置:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 256M
php_flag display_errors Off

这些需要 补丁 0001 才能通过 lsphp 生效。