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]

People Also Like

  • Mail.Baby email goes to SPAM

    My mail.baby mails goes to gmail spam folder After I switched to mail.baby from mailchannels and saw increase in email going to gmail spam folder…

  • High Dwell Time For Your Site – Tips

    Make above-the-fold area of your webpage work better to increase dwell time Most SEOs charge $1000 fee to advice you about this! But I’m giving…

  • Gemini.Google.Com

    Google Gemini official site Though Google recently registered a new domain name gemini.google for their Gemini AI chatbot, the Gemini can be accessed by its…

  • Web Hosting Provider in Monroe, Wisconsin

    Need cheap cpanel hosting in Monroe I’m having a Buggyworks Restaurant in Monroe, Wisconsin and need a cheap web hosting with cPanel, prefebly shared or…

  • Asura Hosting cPanel Migration

    I want to migrate out from Asura Hosting I found faster and reliable web hosting with The-Online.com where I hosted a new website. But I…