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 example.com with your own domain name. Do not edit anything else in the code.

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [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?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

The Community Support team wrote the article you're looking at now. We like to think it's perfect, but we're sure you have some suggestions. Please, let us know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Google Adwords Credit Link Doesn't Work in AMP
  2. my email is being rejected
  3. Can I run the FiverrScript on my hosting

Support Center Search

Current Customers

Email: support@WebHostingHub.com 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.