Skip to content

Instantly share code, notes, and snippets.

@thesaurabhk
Last active June 2, 2017 21:52
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 thesaurabhk/54d1d81235043a5609f542863e4ad6ac to your computer and use it in GitHub Desktop.
Save thesaurabhk/54d1d81235043a5609f542863e4ad6ac to your computer and use it in GitHub Desktop.
#
# Paste the following code into your .Htaccess file
# Do not forget to replace sample.com with your own domain name
#
# TN – DISABLE IMAGE HOTLINKIING START
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sample.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
# TN – DISABLE IMAGE HOTLINKIING END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment