Thursday, December 2, 2010

Image Hotlink Protection In Wordpress

There are certain hotlink Wordpress plugins that do the job of hotlink protection of images on your site. If you are using Wordpress, you can simply create a .htaccess file from the code below and upload it to your uploads folder which is in your wp-content folder. Make sure the filed is named .htaccess In the code below make sure to change the to whatever your domain is. Also add any other file extensions you might want to prevent being hotlinked. to this group jpg|jpeg|png|gif in the code below. Usually though it is just images that folks want to protect. After you upload it. Clear your browser cache and test that an image can be hotlinked at a site like this. There are many of these sites all over the net. No matter how busy or slow a site is, it would not be surprising to see an image of your hotlinked every now and again. This htaccess folder can also be used in any other folder where you might use images as well.

# BEGIN HotLinkProtection
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
# END HotLinkProtection

Related Posts by Categories



Twitter Updates

    follow me on Twitter

    Build A Niche Store Blog. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted by Bloganol dot com Privacy Policy