Invalid line in .htaccess after a plugin update: HTTP 500 on every page
サイト所有者に見えていた症状
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-FPM | 500 | 500 | Apache error log: Invalid command. |
| nginx + PHP-FPM | 200 | 200 | nginx does not read .htaccess; the failure does not occur on this setup, so no run was made here. |
各実行の結果
| 日付(UTC) | サーバー構成 | 接続方式 | 結果 | 製品バージョン | 備考 |
|---|---|---|---|---|---|
| 2026-11-06 | Apache + PHP-FPM | SSH | Recovered | 2.1.434 | The recovery removed the one unrecognized line and kept the other rules. |
| 2026-11-06 | Apache + PHP-FPM | FTP | Declined at the pre-payment check | 2.1.434 | First FTP attempt; see gaps. |
| 2026-11-06 | Apache + PHP-FPM | FTP | Recovered | 2.1.434 | Second FTP attempt after the change below. |
| 2026-11-06 | Apache + PHP-FPM | SSH | Recovered | 2.1.435 | Re-test after later changes shipped. |
ギャップと修正版
「復旧」以外で終わった実行はすべてここに記載します:変更内容、修正を含むバージョン、再実行の日付と結果。
| 発見日 | サーバー構成 | 接続方式 | 変更内容 | 修正版 | 再実行 |
|---|---|---|---|---|---|
| 2026-11-05 | Apache + PHP-FPM | SSH | The 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.434 | 2026-11-06 · Recovered |
| 2026-11-06 | Apache + PHP-FPM | FTP | On an FTP server that hides dot-files from directory listings, the check treated .htaccess as missing. The check now sees hidden files. | 2.1.434 | 2026-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 のバージョンが異なれば結果も異なることがあります。