This is an old revision of the document!


How to enable hotlink protection in .htaccess for LSWS?

A hotlink occurs when someone embeds content from your site in another site and uses your bandwidth to serve the files.

On cPanel, there is a hotlink protection feature you can enable for apache, “cPanel » Home » Security » Hotlink Protection” and enable/disable hotlink protection. but this may not work for LSWS. How to enable hotlink protection on LSWS? You can add the following rewrite rules to .htaccess of related domains( to replace “YOURDOMAIN” with your own domain) :

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?YOURDOMAIN.com/.*$ [NC]
RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F]
  • Admin
  • Last modified: 2018/09/19 18:08
  • by Jackson Zhang