How to prevent other sites hotlinking your images in Cpanel

Share this:

Hotlinking occurs when a user links directly to an image or media file on your website rather than uploading the file to their own server. Once a common practice, hotlinking is now recognized as a potential problem and can be prevented using tools available in cPanel.

The Negative Effects of Hotlinking

Since hotlinking causes media to be downloaded from the source URL, it uses bandwidth from the hosting site rather than the site displaying the file. If you’re using shared hosting or another service that limits your bandwidth, too many external requests can cause you to reach your limit. This could result in downtime, overage charges or both depending on your host.

If you have a gallery of your own images for sale on your site, hotlinking infringes on your copyright. Although people may not link with the intention of stealing, they’re still displaying your personal work on their site without your permission. Having your images on another site can also undermine your ability to make a profit by driving traffic away from your site. The same is true if you rely on display advertising to supplement your income or support your web presence.

Preventing Hotlinking with cPanel

If you host an image gallery, video clips, clipart or any other kind of media, you may want to consider using hotlink protection in cPanel to prevent bandwidth theft. Hotlink protection works by looking at the URL requesting a file and blocking the request if it’s not from your site. This can be activated through the cPanel dashboard.

Enable Hotlink Protection

After logging into cPanel, scroll down to the Security heading and click on Hotlink Protection.

prevent image hotlinking

You’ll see a message stating that “hotlink protection is currently disabled.” Click the Enable button to turn protection on.

cpanel hotlinking

This should bring you to a screen confirming that hotlink protection has been successfully enabled.

Allow Selective Access

There may be certain URLs that you want to hotlink your site’s media. This may include alternate domains that you own or specific trusted websites. To allow hotlinking from these sites, enter the URLs in the “list the URLs to which you wish to allow access” box under Configure Hotlink Protection.

image hotlinking

Your host may automatically list your domain in this box. Type additional URLs on separate lines.

Control Direct Access

Choose the file types that you wish to protect against hotlinking by listing the desired file extensions in the “block direct access for the following extensions” box.

01-09-2015-12-21-05

To allow users to access files by typing the exact URL of the file into their browsers, click the “Allow direct requests” box. This may be desirable if you have images that are linked to larger versions through external thumbnails or if you have media on your site that must be viewed with an outside program such as QuickTime.

Choose a Redirect URL

You may choose to redirect hotlink requests to a custom page. To do so, design the page you want to use as your redirect, upload it to your host and paste the URL in the “redirect the request to the following URL” box.

01-09-2015-12-21-38

Once all settings are in place, click the Submit button.

01-09-2015-12-22-36

Note that enabling hotlink protection can cause your website to run more slowly since the server has to check every image and media request to determine if it’s from an allowed URL. Your images may also not display properly in RSS feeds. If you find that hotlinking protection is detrimental to your site, it can be disabled any time from the same area of cPanel in which you enabled it.

Comments

comments