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

  • Hudson Valley Wedding DJ Site Not Ranking

    My site Hudson Valley Wedding DJ is not ranking in Google I just moved my site from Namecheap to The-Online.com cPanel hosting plan, and my…

  • Jio Eat Food Delivery Fraud in India

    Fraudlent website JioEat.in duped users ordering food online Jio Eat is a new scam website where fraudster are using Reliance brand name to dupe customers…

  • Offshore Shared Hosting

    Need secure offshore shared web hosting that is affordable Most offshore web hosting providers which offer offshore shared hosting like Linux or Windows with cPanel…

  • Cloud .yun gTLD to be launched

    Chinese software company Qihoo 360 is set to launch .yun, the Pinyin transliteration of the Chinese word and Mandarin character meaning “cloud“. The ICANN web…

  • VPS with Port 25 Open

    Need to buy VPS with port 25 open for sending emails Most VPS companies including the low end ones and premium providers do not allow…