Prohibit direct linking to your site


Sick of people direct linking ( ) images from your site ?

Use this under an .htaccess file or your apache configuration (modrewrite needed)

This one would display the image owner.jpg : RewriteEngine On RewriteCond %{HTTP_REFERER} ^.**$ [NC] RewriteRule .*.(gif|jpg|jpeg|swf|png)$ [NC]

This one would block direct linking, at all : RewriteEngine On RewriteCond %{HTTP_REFERER} ^.**$ [NC] ReWriteRule .*.(gif|png|jpg|jpeg|swf)$ - [F]

Thanks for reading this post!

If you found an issue in this article, you can create an issue on Github.

If you have a comment or question, please drop me a line below!