Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
litespeed_wiki:cpanel:enable_hotlink_protection [2018/09/19 18:07] Jackson Zhang created |
litespeed_wiki:cpanel:enable_hotlink_protection [2018/09/19 20:51] Lisa Clarke Proofreading |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== How to enable hotlink protection in .htaccess for LSWS? ====== | + | ====== 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. | + | A hotlink occurs when someone embeds content from your site into another site and uses //your bandwidth// to serve the files. |
- | On cPanel, there is a [[https://documentation.cpanel.net/display/74Docs/Hotlink+Protection|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: | + | On cPanel, there is a [[https://documentation.cpanel.net/display/74Docs/Hotlink+Protection|hotlink protection feature]] you can enable for Apache. Navigate to **Home > Security > Hotlink Protection** and enable or disable it. |
+ | |||
+ | This may not work for LiteSpeed Web Server. To enable hotlink protection on LSWS, you can add the following rewrite rules to the ''.htaccess'' of the relevant domains. be sure to replace ''YOURDOMAIN'' with your own domain: | ||
RewriteEngine on | RewriteEngine on | ||
RewriteCond %{HTTP_REFERER} !^$ | RewriteCond %{HTTP_REFERER} !^$ | ||
- | RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?testing.quicserver.com/.*$ [NC] | + | RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?YOURDOMAIN.com/.*$ [NC] |
RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F] | RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F] | ||
- | |||
- | |||
- | |||