Hotlink protection prevents other websites from directly linking to files on your website.  When sites link to your files, it uses your hosting resources. Hotlink protection doesn't stop other sites from using your images, only from linking to your site directly.

Before enabling Hotlink Protection, please consider the following:

  • HotLink Protection enabled through cPanel may cause issues if you are using a CMS (Content Managment System) such as WordPress, Joomla or Drupal. You should use a plugin or extension for your CMS. You can also manually edit the .htaccess file yourself in order to enable HotLink Protection on a site that is built with a CMS.
  • When you turn on Hotlink Protection, it is turned on for your entire account. If you host more than one domain, you will want to add each domain in the URLs to allow access field.
  • FrontPage Extensions may not work properly after enabling HotLink Protection through cPanel because the .htaccess file (also used by FrontPage Extensions) is overwritten. It is recommended to simply add the hotlink protection manually to your .htaccess file (after any code entered by FrontPage extensions). Code for HotLink protection would be as follows (replace yourdomain.com with your actual domain name):

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

    You can also add other file types if needed in the last line (jpg|jpeg|png|gif). You can edit your .htaccess file using the cPanel File Manager.

To enable Hotlink protection, first log into your cPanel. Under "Security", click on HotLink Protection:

hotlink1

The next page will display the different options for setting up Hotlink Protection:

hotlink2

  • URLs to allow access:  This is a list of sites that are allowed to link to your content. This list will include your own site, plus any other domains you host. You can add more by adding another website onto the list.
  • Block direct access for these extensions: Here you can list the extensions you want to block. By default, image extensions are blocked, but you can add more extensions if needed. For example if you have movies, you can block .wmv or .mpg from being hotlinked.
  • Redirect request to this URL: This is optional. If you want to redirect anyone that hotlinks to your site, you can do so in here.

Once you are done, click submit. Always visit your site after enabling Hotlink Protection to make sure it did not effect anything on your website. You can Enable and Disable Hotlink Protection any time.

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
Name

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

Name:
Email Address:
Phone Number:
Comment:
Submit

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: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 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.
}