LoginSignup
22
19

More than 5 years have passed since last update.

Basic認証下でFacebook等のOGP確認方法

Last updated at Posted at 2013-05-13

開発中のサイトでOGPの動作確認をしたい時、
Basic認証をかけているとFacebookやmixi等のクローラがOGPタグを取得・解析出来ない。
そこで、それらクローラからのアクセスは以下の様にBasic認証無しにする。

.htaccess
AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
AuthName "Input ID and Password."
AuthType Basic

BrowserMatchNoCase facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php) is_facebook=1
BrowserMatchNoCase mixi-check/1.0 (http://mixi.jp/) is_mixi=1

Satisfy any
Require valid-user
Order allow,deny

allow from env=is_facebook
allow from env=is_mixi

allow from localhost
allow from 127.0.0.1
allow from 192.168.11.0/24
22
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
19