Prevent Hotlinking Static Content On Your Site

Add this to your .htacces file.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)example.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ - [F]
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Domain redirect

So you bought another domain name that matches one you currently have.  You shouldn’t...

restrict by IP or password

I find myself tired of having to answer the pop up authentication box to view my control panel...

rewrite base

Top directories can break functionality on sub directories. Case in point:Scenario: WordPress...

rewrite non SSL to SSL

Want to force users to use SSL on your site?Add this code to the top of your .htaccess file, edit...

Traffic source redirect

Need to redirect source traffic to another domain?  Well, if you can’t modify the link...