Disable Hotlinking in WordPress


D

Hotlinking refers to someone directly linking to one of your images on their own server. What this means is that when someone visits their site it has to load the image from your server, taking up your bandwidth. You can disable hotlinking by adding the following code to your .htaccess file and updating it with your domain name.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

After implementing hotlinking, images on external sites will show up as broken, a 403 error in the header.

About the Author: admin

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *

Start an internet business today!