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

  • PPC Management in Sydney Australia

    I need a reliable PPC management company in Sydney for my Google Ads Need PPC management in Sydney, Australia for to run my Google Ads….

  • Pune WordPress Host

    Any good wordpress hosting in Pune I came from wordcamp pune post. My friend attended the wordpress conference which was sponsored by The-Online.com who provides…

  • Secureserver.net Login

    I wanted to manage my domain name and web hosting account via sso.secureserver.net or secureserver.net login page but it does not load for me. What is the correct URL for secureserver.net login page? secure-server.net official website

  • CraneMail with iOS Push and RClone Support

    Cranemail email hosting now comes with rclone and iOS push feature Cranemail implemented Z-Push which is an open source ActiveSync implementation that allows you to…