Monday, February 23

What is Hotlinking, bandwidth theft OR almost perfect htaccess file for wordpress blogs.

Hotlinking is also known as bandwidth theft.

It is when other sites direct link to the images on your site from their articles making your server load increasingly high.

If one site does it, it might not make a significant difference, but there are too many spammers that will do this and that is something your server cannot hold specially if they copy your article with a lot of images.

No matter how good your web host is, it will be slowed down if hotlinking is not prevented.

There are a few ways you can disable hotlinking. First way we will share is through your root .htaccess file where you will place this code below:

    #disable hotlinking of images with forbidden or custom image option
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?wpbeginner.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/wpbeginner [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L] 
 
You can make an image that will replace all hot linked image that will say Stealing is bad or something so it makes the spammer look stupid.
Remember you must allow your feed otherwise your feed readers would not see any images.

Source: Josiahcole

No comments:

Post a Comment