Search our database

How To Protect Your Bandwidth From Hotlinking Images

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 how to do that by writing certain codes in your .htaccess file.

 

Step 1 – Copy and paste the following code into your .htaccess file and place it in your public_html foler. Replace “mydomain.com” with your own.

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

 

From here onwards, any hotlinked images will be broken if it is not loaded on your website/domain.

 

Affordable but Powerful Cloud Hosting Package

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

Tags: ,