ことの是非はともかく、WordPressをindex.htmlでアクセスされた時でも表示したいというケースは多々あります。 もちろん .htaccess でリダイレクトしても良いのですが、今回はWordPress側で行える簡単な対策を紹介します。 WordPressは、パーマリンクの利用時に、環境変数の $_SERVER[‘REQUEST_URI’] を元に、表示条件を決定しています。このため、表示条件を割り出しを行う前に、環境変数自体を改変し、index.htmlを削除してしまえば、index.html 付きのアクセスでも表示は可能になります。 CODE 1は、この考え方を元に、$_SERVER[‘REQUEST_URI’]をWordPressが表示条件の割り出しが出来、なおかつ非正規のリクエストと認識されるように書き換えます。 非正規のリクエストの場合、WordPressは wp-in