Prohibit direct linking to your site

categories:

Sick of people direct linking ( http://en.wikipedia.org/wiki/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} ^.*myspace.com.*$ [NC] RewriteRule .*.(gif|jpg|jpeg|swf|png)$ http://www.site.be/images/owner.jpg [NC]

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




Thanks for reading this post!


Did you find an issue in this article?

- click on the following Github link
- log into Github with your account
- click on the line number containing the error
- click on the "..." button
- choose "Reference in new issue"
- add a title and your comment
- click "Submit new issue"

Your feedback is much appreciated! πŸ€œπŸΌπŸ€›πŸΌ

You can also drop me a line below!