Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hotlink Protection Htaccess Openlitespeed
- 1. Editor
- nano /usr/local/lsws/Example/html/wordpress/.htaccess ( default path instalation)
- enter the code and restart
- service lsws restart
- 2. Method Web Admin Concole
- open webadmin yourdomain.com:7080 -> login
- Virtual Host > Host Virtual List > View > Rewrite > Rewrite Control
- Enable Rewrite: Yes
- Auto Load from .htaccess: Yes
- Log Level: 9 (optional, select between 1 - 9 )
- scroll to the bottom and type the htaccess rewrite command in the rewrite rules field.
- Virtual Host > Host Virtual List > View > Rewrite > Rewrite Rules
- RewriteRule ^(.*)$ https://yourdomain.com%{REQUEST_URI} [R,L]
- RewriteCond %{HTTP_REFERER} !^$
- RewriteCond %{HTTP_REFERER} !yourdomain.com [NC]
- RewriteRule \.(gif|jpg|png|bmp|webp|mp4)$ /images/hotlink-warning.jpg [R,NC]
- Also
- RewriteEngine on
- RewriteCond %{HTTP_REFERER} !^$
- RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com/.*$ [NC]
- RewriteRule \.(jpg|jpeg|gif|png|bmp|mp4)$ - [F]
- and check progress image or vid url to
- https://altlab.com/hotlinkchecker.php
Advertisement
Add Comment
Please, Sign In to add comment