How To Prevent Website From Hotlinking on Apache Server

Guide to prevent hotlinking images on Apache server

Hotlinking is the process of stealing someone’s website bandwidth by directly adding assets from one website to another. These assets can be images, videos, or audio. The other websites embed your images, videos and audio by copying the HTML code.

If your website is hosted on an Apache server then you can follow these simple steps to enable hotlink protection on an Apache server is easier than you might think.

Open the .htaccess file in your root directory of the Apache server and add the following code:

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC]

RewriteRule \.(jpg|jpeg|png|gif|svg)$ https://dropbox.com/hotlink-placeholder.jpg [NC,R,L]

Similar Topics

  • $1.99 Domain

    Where to register $1.99 domain with promo code? I want to register domain name for $1.99 (I saw a promo code on retailmenot) But that…

  • Iran Israel News Live

    Get iran israel live news here. Iran israel latest news live on tv, youtube video, iranintl.com web-site, al jazeera, new-s. news about iran israel usa…

  • $5 .COM Domain Deals

    SAVE with $5 .com domain registration deals So where can you get $5 domain registration? Well, some domain registrar offer limited-time .com domain deals and…

  • BSNL Blocks Legit Websites

    List of websites blocked by BSNL in India BSNL telecom operator has blocked following websites without court-order in one or more telecom circles in India,…

  • Buy .EDU domain name for cheap

    Want to buy .edu domains I need to start a website related to science education and need to buy .edu domain name for cheapest price….

  • Mxroute Resellers

    Any mxroute resellers for sending email I need to buy domain email plan from mxroute reseller which can provide me single domain email account for…