oe7drt-website/static/.htaccess

23 lines
678 B
ApacheConf
Raw Normal View History

Header set Access-Control-Allow-Origin: https://oe7drt.com
Header set Vary: Origin
2023-11-19 02:52:31 +01:00
# 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
RewriteCond %{REQUEST_URI} !hotlinked\.png$
RewriteCond "%{HTTP_REFERER}" "!^$"
RewriteCond "%{HTTP_REFERER}" "!oe7drt.com" [NC]
2023-11-19 02:52:31 +01:00
RewriteRule "\.(gif|jpe?g|png)$" "https://oe7drt.com/hotlinked.png" [R,L]
# sends a 403 Forbidden
2023-11-19 02:52:31 +01:00
# SetEnvIf Referer "oe7drt\.com" localreferer
# SetEnvIf Referer ^$ localreferer
# <FilesMatch "\.(jpg|png|gif)$">
# Require env localreferer
2023-11-19 02:52:31 +01:00
# </FilesMatch>