Skip to content

Instantly share code, notes, and snippets.

@syuji-higa
Last active November 16, 2019 04:57
Show Gist options
  • Save syuji-higa/1678d5cec5c9885e79877dbc63866efe to your computer and use it in GitHub Desktop.
Save syuji-higa/1678d5cec5c9885e79877dbc63866efe to your computer and use it in GitHub Desktop.
htaccess - defaualt setting
SetEnvIf User-Agent "^facebookexternalhit" facebook
SetEnvIf User-Agent "^Twitterbot" twitter
SetEnvIf User-Agent "^mixi-check" mixi
SetEnvIf User-Agent "Android" android
SetEnvIf User-Agent "\(\+https:\/\/developers\.google\.com\/\+\/web\/snippet\/" google
Satisfy Any
Order Deny,Allow
Deny from all
AuthType Basic
AuthName "Basic Auth"
AuthUserFile /home/username/sample/.htpasswd
Require valid-user
Allow from env=facebook
Allow from env=twitter
Allow from env=mixi
Allow from env=google
<Files ~ "\.(mov|mp4|mp3|m4v|flv|f4v)$">
Allow from env=android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment