Search Our Database

How To Protect Your Bandwidth From Hotlinking Images

Last updated on |
by

If you are hosting your own images, it is important to safeguard your bandwidth by preventing others from hotlinking your images. In this tutorial, we will guide you on how to accomplish this by modifying the .htaccess file.

 

Simply add the following code into your .htaccess file and place it in your public_html folder.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg|js|css)$ - [F]

 

*Be sure to replace mydomain.com with your domain name.

Any hot-linked images from your website will be broken if the images are not loaded on your website.

 

Affordable but Powerful Cloud Hosting Package

Check out IPServerOne’s Cloud Hosting Packages.
Contact us @ +603-6259-5625 or email @ sales@ipserverone.com