How to Prevent Your Site From Image Hotlinking

| Last Updated: | In: Code Snippets


In this tutorial, I will explain how to prevent your site from image hotlinking. This will help you to save
your server bandwidth and cost.

What is Image Hotlnking

Image hotlink is the direct linking to your website’s image files to theft your server Bandwidth. Some people have used your site’s images directly on his website like:

When hotlinking website is loaded, then images are loaded from your website and it used your server bandwidth & costing.

How to Prevent Your Site From Image Hotlinking

You can prevent your website from image hotlinking by using the below code at the end of your htacess file.

In the above code if someone has used your site’s images, then it will be redirected to a custom image. Please keep in mind, this will also affect for search engine & RSS feeds. You can allow all the search engine and RSS feeds to access your site’s images by using below code.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:

Tags: , , , , ,