電子書籍の厳選無料作品が豊富!

.htaccessで特定IPからのアクセスはそのまま許可し、それ以外のIPからのアクセスはBasic認証を行う というのは可能でしょうか?

A 回答 (2件)

Satisfy anyですね



###以下 .htaccess
AuthUserFile /home/hoge /.htpasswd
AuthName "ID and password"
AuthType Basic

require valid-user
Satisfy any
# ↑ これを記述するとどちらかの条件をクリアすればOKになる
order deny,allow
deny from all
allow from xxxxxxx
#      ↑パスワードを求めないアドレスを記述
###以上
SetenvIf と組み合わせると 特定の環境変数(User_AgentとかCookieとか)
の値のときのみパスワードを求めないなんてことも出来ます
http://oshiete1.goo.ne.jp/qa2078751.html
    • good
    • 0

AllowOverride AuthConfig





AuthName,AuthUserFile
等のユーザ認証に関するディレクティブを許可できます。
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!