update hotlinking-prevention

main
Dominic Reich 11 months ago
parent 168a0b2c8f
commit e0f0fbaf43
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -1,15 +1,22 @@
Header set Access-Control-Allow-Origin: https://oe7drt.com Header set Access-Control-Allow-Origin: https://oe7drt.com
Header set Vary: Origin Header set Vary: Origin
# Hotlink images prevention
# rewrite to the `hotlinked.png` image and show this to any
# hot-linking origin page
# https://techexpert.tips/apache/apache-prevent-image-hotlinking/
RewriteEngine On RewriteEngine On
RewriteCond %{REQUEST_URI} !hotlinked\.png$ RewriteCond %{REQUEST_URI} !hotlinked\.png$
RewriteCond "%{HTTP_REFERER}" "!^$" RewriteCond "%{HTTP_REFERER}" "!^$"
RewriteCond "%{HTTP_REFERER}" "!oe7drt.com" [NC] RewriteCond "%{HTTP_REFERER}" "!oe7drt.com" [NC]
RewriteRule "\.(gif|jpg|png)$" "https://oe7drt.com/hotlinked.png" [R,L] RewriteRule "\.(gif|jpe?g|png)$" "https://oe7drt.com/hotlinked.png" [R,L]
# sends a 403 Forbidden
#SetEnvIf Referer "oe7drt\.com" localreferer # SetEnvIf Referer "oe7drt\.com" localreferer
#SetEnvIf Referer ^$ localreferer # SetEnvIf Referer ^$ localreferer
#<FilesMatch "\.(jpg|png|gif)$"> # <FilesMatch "\.(jpg|png|gif)$">
# Require env localreferer # Require env localreferer
#</FilesMatch> # </FilesMatch>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Loading…
Cancel
Save