Last active
October 27, 2025 21:39
-
-
Save luizbills/6f81789b5be0987811fe11d170f3fc2f to your computer and use it in GitHub Desktop.
Hotlink protection for Apache or OpenLiteSpeed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # BEGIN HOTLINK PROTECTION | |
| RewriteEngine on | |
| RewriteCond %{HTTP_REFERER} !^$ | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC] | |
| RewriteRule \.(jpg|jpeg|png|gif|svg)$ - [NC,F,L] | |
| # END HOTLINK PROTECTION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment