Back to knowledgebase

How to Set Up Hotlink Protection in cPanel

Hotlink Protection screen in cPanel

Open Hotlink Protection

  1. Go to Security > Hotlink Protection.
  2. Check the list of URLs that are allowed to access your files.

Enable Hotlink Protection

  1. Add any website URLs that should be allowed to display your files.
  2. Add the file types you want to protect, such as jpg, jpeg, gif, png, or webp.
  3. Enter a redirect URL if you want blocked visitors to go to another page.
  4. Tick Allow direct requests only if visitors should still be able to open protected files directly in a browser.
Hotlink Protection settings form
  1. Click Submit.
  2. Click Enable if cPanel shows a separate enable button.

Disable Hotlink Protection

  1. Go to Security > Hotlink Protection.
  2. Click Disable.
  3. Confirm the change if cPanel asks.

Notes

  • Add both the http and https versions of any domain that should be allowed.
  • Include your own domain names before enabling protection.
  • Hotlink Protection usually works by changing rules in the website’s .htaccess file.