Skip to content

Instantly share code, notes, and snippets.

@ReekenX
Created March 19, 2014 05:08
Show Gist options
  • Select an option

  • Save ReekenX/9635738 to your computer and use it in GitHub Desktop.

Select an option

Save ReekenX/9635738 to your computer and use it in GitHub Desktop.
Prevent hotlinking
RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment