初步評估

Invalid line in .htaccess after a plugin update: HTTP 500 on every page

配方 20261105-htaccess-bad-waf-block · 最新一跑 2026-11-06 · 首次發布 2026-11-09 · 更新 2026-11-09 · Forum case

站主看到什麼

A security plugin update wrote a line into .htaccess that Apache does not recognize. Every page, including the login page, returned HTTP 500, and the Apache error log showed "Invalid command".

出處(公開論壇帖): https://wordpress.org/support/topic/server-error-after-updating-to-1-5-5-quick-fix-and-update-to-1-5-6/

測試環境與弄壞後看到什麼

測試站:WordPress 7.1、PHP 8.3。下表是照配方弄壞之後,首頁與登入頁回的 HTTP 狀態。

主機環境首頁登入頁備註
Apache + PHP-FPM500500Apache error log: Invalid command.
nginx + PHP-FPM200200nginx does not read .htaccess; the failure does not occur on this setup, so no run was made here.

每一跑的結局

日期(UTC)主機環境連線模式結局維修站版本備註
2026-11-06Apache + PHP-FPMSSHRecovered2.1.434The recovery removed the one unrecognized line and kept the other rules.
2026-11-06Apache + PHP-FPMFTPDeclined at the pre-payment check2.1.434First FTP attempt; see gaps.
2026-11-06Apache + PHP-FPMFTPRecovered2.1.434Second FTP attempt after the change below.
2026-11-06Apache + PHP-FPMSSHRecovered2.1.435Re-test after later changes shipped.

缺口與修在哪一版

結局不是修好的跑次,都在這裡:改了什麼、修在哪一版、重跑的日期與結局。

發現日主機環境連線模式改了什麼修在哪一版重跑
2026-11-05Apache + PHP-FPMSSHThe pre-payment check declined a site that returned HTTP 500 on every page, which is the state the site owner reports. The check now accepts a site in this state.2.1.4342026-11-06 · Recovered
2026-11-06Apache + PHP-FPMFTPOn an FTP server that hides dot-files from directory listings, the check treated .htaccess as missing. The check now sees hidden files.2.1.4342026-11-06 · Recovered

對到的故障項目

補充

The first attempt, on 2026-11-05 over SSH, was declined at the pre-payment check (first row in the gaps table). The product version of that attempt was not recorded, so it is not listed as a run.

這些是我們測試主機上、某一版、某一天的紀錄,不是對任何網站結果的承諾;其他主機、PHP 與 WordPress 版本的結果可能不同。

初步評估 →