⚡
LiteSpeed

Setting up LiteSpeed hotlink protection in Plesk

📅 7 octobre 2026 ✏️ 7 octobre 2026 ⏱ 4 min leestijd

Prevent others from loading your images directly. Step-by-step guide to setting up hotlink protection on LiteSpeed servers via Plesk.

Hotlinking means that other websites link directly to images or files on your server, using your bandwidth and putting extra load on your server without visitors actually visiting your site. With LiteSpeed hotlink protection, you block this at the server level, so files only load via your own domain or permitted exceptions. This article shows how to set it up via Plesk and manually via .htaccess.

What is hotlink protection and why is it needed

Hotlinking happens when someone loads an image or video from your server directly on another website, without hosting the file themselves. The visitor sees the image, but the data traffic and server load are entirely your responsibility. With a lot of traffic, this can noticeably affect your site’s speed, especially if you use shared hosting.

LiteSpeed servers have built-in support for hotlink protection via the rewrite module. You set up a rule that checks whether a request for an image or file comes from your own domain. If the request comes from elsewhere, the server denies the file or shows an alternative image.

Your websiteServer (LiteSpeed)Image loadedForeign siteblocked

Setting up hotlink protection via Plesk

In Plesk, you’ll often find hotlink protection under the Apache & nginx settings or as a separate extension, depending on the configuration of your hosting package. At Tandata, you can find this in the Plesk control panel of your web hosting package.

1

Log in to Plesk

Go to your Plesk environment and open the domain for which you want to set up hotlink protection.

2

Open Apache & nginx settings

Look for the section where you can add additional directives for Apache or nginx at the domain level.

3

Add the rewrite rule

Place the rule from the next section in the field for additional Apache directives and save the settings.

4

Check the result

Visit your site from a different domain or use a separate test page to see if images are correctly blocked.

Manual setup with .htaccess on LiteSpeed

LiteSpeed supports standard Apache syntax in .htaccess files by default, including mod_rewrite. Add the code below to the .htaccess file in the root directory of your website:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://(www.)?yourdomain.com/.*$ [NC]
RewriteRule .(jpg|jpeg|png|gif|webp)$ - [F,NC,L]

Replace yourdomain.com with your own domain name. This rule checks the referer header of every request for image files. If the referer is empty or does not match your domain, the server returns a 403 Forbidden error instead of the image.

💡 Tip: Want to show a replacement image instead of an error message, for example with your logo? Replace [F,NC,L] with a RewriteRule that redirects to your own placeholder image.

Testing and adding exceptions

Always test that legitimate use isn’t accidentally blocked. Think of search engines indexing your images, social media showing preview images, or your own emails loading images from your domain. Add an extra RewriteCond rule for each desired exception, with the corresponding referer or user-agent.

Also check whether email clients continue to display images correctly if you use images in newsletters sent via your business email. After setting up the rule, always test it on multiple devices and browsers, and keep an eye on error logs for unexpected blocks.

If you get stuck while testing or want to have the configuration checked, consult the knowledge base or contact support.

Frequently asked questions

Does hotlink protection also work for videos and PDFs?

Yes, you can add extra file extensions to the RewriteRule, for example mp4 or pdf, so those files are protected as well.

Does hotlink protection also block search engines?

Not by default, because search engine crawlers often don’t send a referer when indexing images. Still, test this after setting it up to be sure.

Can I set up hotlink protection per folder instead of for the whole site?

Yes, place a separate .htaccess file with the rewrite rule in the specific folder you want to protect.

What happens if I make a mistake in the rule?

An incorrect rewrite rule can lead to a server error (500) on your site. Always make a backup of the .htaccess file before making changes.

Is hotlink protection the same as a CDN?

No, a CDN distributes content across multiple servers for speed, while hotlink protection specifically blocks unauthorized use of your files by other websites.

Conclusion

With hotlink protection on your LiteSpeed server, you prevent other websites from using your hosting bandwidth without permission. Via Plesk, you can set this up easily with a rewrite rule, or you can add the code manually to your .htaccess file. Always test carefully for exceptions such as search engines and email clients before leaving the rule permanently active.

View web hosting →

Was dit artikel nuttig?