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]
Social Share or Summarize with AI

Similar Topics

  • Best Platform to Backorder Domain Name

    Which provider offers best domain backorder service? After godaddy and few other major domain registrars closed their domain backorder service, which are some of the…

  • Email.Secureserver.net Login

    Accessing email on secureserver.net domain I just purchased Professional Email plan and want to access it on the https://email.secureserver.net domain name. Is this the right…

  • Buy .CA Domain for Cheap

    Need to buy .ca domain recommend best provider in Canada I am from Toronto, Canada and I have made a website using website builder from…

  • $1 .INFO Domain

    Register .INFO domains for $1 The Online – your favorite domain registrar and web hosting provider has recently launched .info domain promotion. Users can register…