How to set hotlink protection in Plesk ?

Hotlink protection in Plesk to prevent unauthorized users from embedding your content, such as images or videos, directly on their websites. This guide explains how to enable hotlink protection in Plesk for your website in Plesk. Follow these steps carefully to ensure your website’s content remains secure.

Hotlinking occurs when another website directly links to files (like images or videos) hosted on your server. This not only uses your bandwidth but also can expose your resources to unauthorized use. Enabling hotlink protection ensures that only specified domains can use your hosted files.

Prerequisites

  1. Access to your Plesk control panel.
  2. Administrative privileges for your hosting account.
  3. A clear list of domains authorized to access your files.

Step 1: Log In to Plesk

  1. Open your browser and navigate to the Plesk control panel URL provided by your hosting provider.
  2. Enter your username and password.
  3. Click Log In to access your dashboard.
Check Usage Statistics in Plesk
  1. In the Plesk dashboard, navigate to Websites & Domains.
  2. Select the domain where your website is hosted.
  3. Scroll down and look for Hotlink Protection in plesk or similar settings. If you don’t see it, it might be under security section.
  1. Click on Hotlink Protection to open its configuration.
  2. Enable the option by checking the box labeled “Enable Hotlink Protection.”
  3. Specify the types of files you want to protect. For example:
  • .jpg, .png, .gif for images
  • .mp4, .avi for videos
  • Any other file extensions relevant to your website.
hotlink protection in Plesk

Step 4: Allow Authorized Domains

  • Add your own domain (e.g., anydomain.com) to the list of allowed domains.
  • If you want other trusted domains to access your files, list them here as well. For example:
  • example.com
  • trustedpartner.com
  • Use the format *.domain.com to allow subdomains or domain.com for specific domains.

Step 5: Save and Apply Changes

  1. After configuring the settings, click Save option to save the changes.
  2. Plesk will update the server configuration to enforce hotlink protection.

After enabling hotlink protection, verify its effectiveness:

  1. Visit your website and check if the images and videos load correctly.
  2. Try to access one of your protected files directly from an unauthorized domain.
  • For example, embed an image link from your website on another website and see if it displays.
  1. If the file does not load or redirects as configured, your hotlink protection is working.

Troubleshooting Tips

  1. Files Not Loading on Your website:
  • Ensure your domain is listed in the authorized domains section.
  • Double-check file types in the configuration.
  1. Hotlink Protection Not Working:
  • Clear your browser cache and try again.
  • Check server logs for errors or misconfigurations.
  • Ensure hotlink protection is not overridden by custom .htaccess rules.
  1. Custom Redirect URL Not Working:
  • Verify the URL entered is correct and accessible.

Additional Considerations

  1. Impact on SEO: Ensure hotlink protection does not block legitimate bots like Google’s crawler.
  2. Content Sharing: If you want certain users to embed your files, explicitly authorize their domains.
  3. Server Performance: Enabling hotlink protection reduces unnecessary bandwidth usage and improves server performance.

Conclusion

Setting up hotlink protection in Plesk is a straightforward process that helps secure your website’s resources. By following this guide, you can prevent unauthorized usage of your content, save bandwidth, and maintain control over your files. Regularly review and update your settings to adapt to changes in your website’s requirements or partnerships.