Skip to content

Instantly share code, notes, and snippets.

@manhleo93
Created January 20, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manhleo93/bca23ba52183e823b84069a7f78437bd to your computer and use it in GitHub Desktop.
Save manhleo93/bca23ba52183e823b84069a7f78437bd to your computer and use it in GitHub Desktop.
Hướng dẫn chặn hotlinking bằng file .htaccess
#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?sampres.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?google.com [NC]
RewriteRule .(jpg|jpeg|png|gif)$ – [NC,F,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment