kumiskiri

Hotlink Protection Htaccess Openlitespeed - Kumiskiri

Jun 16th, 2023 (edited)
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.07 KB | Source Code | 0 0
  1. Hotlink Protection Htaccess Openlitespeed
  2.  
  3. 1. Editor
  4.  
  5. nano /usr/local/lsws/Example/html/wordpress/.htaccess ( default path instalation)
  6.  
  7. enter the code and restart
  8.  
  9. service lsws restart
  10.  
  11. 2. Method Web Admin Concole
  12.  
  13. open webadmin yourdomain.com:7080 -> login
  14.  
  15. Virtual Host > Host Virtual List > View > Rewrite > Rewrite Control
  16.  
  17. Enable Rewrite: Yes
  18. Auto Load from .htaccess: Yes
  19. Log Level: 9 (optional,  select between 1 - 9 )
  20.  
  21. scroll to the bottom and type the htaccess rewrite command in the rewrite rules field.
  22.  
  23. Virtual Host > Host Virtual List > View > Rewrite > Rewrite Rules
  24.  
  25. RewriteRule ^(.*)$ https://yourdomain.com%{REQUEST_URI} [R,L]
  26. RewriteCond %{HTTP_REFERER} !^$
  27. RewriteCond %{HTTP_REFERER} !yourdomain.com [NC]
  28. RewriteRule \.(gif|jpg|png|bmp|webp|mp4)$ /images/hotlink-warning.jpg [R,NC]
  29.  
  30. Also
  31.  
  32. RewriteEngine on
  33. RewriteCond %{HTTP_REFERER} !^$
  34. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com/.*$ [NC]
  35. RewriteRule \.(jpg|jpeg|gif|png|bmp|mp4)$ - [F]
  36.  
  37. and check progress image or vid url to
  38.  
  39. https://altlab.com/hotlinkchecker.php
Advertisement
Add Comment
Please, Sign In to add comment