I used this code in my .htaccess
file and it is working great to prevent hotlinking:
RewriteEngine On
RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.*
RewriteRule \.(gif|jpg|jpeg|png|tif|pdf|wav|wmv|wma|avi|mov|mp4|m4v|mp3|zip?)$ - [F]
Now I want to allow one of my subdomains (cdn.example.com
) to access my files using a GET request.
It is not possible to add http_reffer to my GET request! I should only handle it with .htaccess
.
How should I add my subdomain as an exception in this code?