> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/websites/hotlink-protection.md).

# Hotlink Protection

Block external sites from embedding your images and media — save bandwidth, stop leeches.

## Enable in hPanel

1. Open your website dashboard.
2. Go to **Hotlink Protection**.
3. Toggle **Enable Hotlink Protection** on.
4. (Optional) Add allowed domains.
5. Click **Save**.

External requests for protected file types return 403 Forbidden.

## Disable

**Hotlink Protection** → toggle off.

## Allow specific domains

For trusted externals (a CDN, partner site, or your own domains):

1. In Hotlink Protection, find **Allowed Domains**.
2. Add domains, one per line.
3. Save.

## Via `.htaccess`

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

This blocks image and media requests from domains other than `yourdomain.com`.

Allow more domains with extra `RewriteCond` lines:

```apacheconf
RewriteCond %{HTTP_REFERER} !^https://(www\.)?anotherdomain\.com/ [NC]
```

## What it protects

Only the file types you specify — typically images, video, audio, and PDFs. HTML pages and other web content aren't affected.

***

*Last updated: July 21, 2026*
