Hotlinking is the process of placing a link to an image housed on another websever directly in your code. If people hotlink to your images, this will use your bandwidth instead of theirs,a lso known as bandwidth pirating. If enough people hotlink to images housed on your server, this can cause your account to use an increased amount of resources. This can slow down your site for legitimate visitors to your site.

You can prevent other sites from hotlinking to your images. Below are the instructions that demonstrate how to prevent hotlinking via your .htaccess file.

Preventing Hotlinking in your .htaccess file

  1. Log into your cPanel
  2. Access the File Manager for the Web Root folder of your domain. Be sure to also select the Show Hidden Files option.
    accessing file manager
  3. Once in the folder, find the .htaccess file and click on the Edit icon found in the toolbar across the top of the page. If you do not have an .htaccess file, you may need to create a blank one before clicking on the icon.
    edit htaccess file
  4. You are now in the file editor. Place the following code into the .htaccess file. Be sure to replace the domain name with your own domain name. Do not edit anything else in the code.

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
    RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F]
  5. Click on the Save Changes button in the upper right corner of the editor to finalize and activate the code. Now anyone trying to hotlink to your images will not be able to display them on their site.



Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.