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

  • Far & Away Dinnerware Site Got Google Penalty

    Help needed to resolve google penalty for farandaway.co domain marked as pure spam Our domain name farandway.co (Far & Away site selling Kitchenware, Dinnerware, Cutlery)…

  • Secureserver.net Email Login

    visit email.secureserver.net to access your webmail, email. Login at secure-server.net website to go to inbox of your email. Godaddy email, DomainsPricedRight email. Views: 19

  • cPanel Hosting Near me

    Need cheap cpanel hosting near me I’m building a small eCommerce site with 10 products and so I need to host it in my own…

  • Google is DeIndexing Gemini Articles

    Google seems to de-index articles created using Gemini AI I have a wordpress blog where I used to write Gemini created articles. I had copy-pasted…