apache2.4でリバースプロキシ配下での.htaccessでIP制限をかけるときの書き方
apache2.2の時とは書き方が違っていてハマったのでメモ。
index.htmlを192.168.0系のIPアドレスのみ許可する場合。
#192.168.0.1/24 SetEnvIF X-Forwarded-For "^192\.168\.0\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$" AllowIP <Files index.html> <RequireAny> Require env AllowIP </RequireAny> </Files>
ちなみにapache2.2の時は以下のように書く
#192.168.0.1/24 SetEnvIF X-Forwarded-For "^192\.168\.0\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$" AllowIP <Files index.html> order deny,allow deny from all allow from env=AllowIP </Files>