I have the next Apache code to prevent hotlinking, and it works.
RewriteCond %{HTTP_REFERER} ^$ [OR]
RewriteCond %{HTTP_REFERER} !^https?://itransformer.*$ [NC]
RewriteRule /usuarios/.*\.(gif|jpe?g|png|wbmp)$ - [R=404,L]
The questions are two:
1.If I change the above to:
RewriteCond %{HTTP_REFERER} ^$ [OR]
RewriteCond %{HTTP_REFERER} !^https?://%{HTTP_HOST}.*$ [NC]
RewriteRule /usuarios/.*\.(gif|jpe?g|png|wbmp)$ - [R=404,L]
it doesn't work. %{HTTP_HOST}
is equal to itransformer
(in my localhost), so I don't understand why it isn't working in this way.
2. The default 404 page is shown instead of my custom 404 page that is shown in all other 404 responses. What can be happening here?