Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
protect your bandwidth from hotlinking images

How To Protect Your Bandwidth From Hotlinking Images
#1
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.


Code:
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.



Dinesh Kumar Mohanty
Ultra Web Solutions®
Bhubaneswar, Odisha, India.

UltratechHost - Your One Stop Offshore & Onshore Hosting Provider
Server Locations : Netherlands, Germany, Russia, Singapore & USA
Service Offers: Shared hosting | Reseller hosting | Cloud server | Dedicated server | VPS Hosting



Forum Jump:


Users browsing this thread: 1 Guest(s)