I have been using .htaccess to block hotlinking of images for years now, but I am unsure how to use this in conjunction with sending announce list emails (or any emails) that include images linked from the website. I know there is a way to write exceptions for images or a folder in the htaccess, but this is tiresome to duplicate and move images every time an email is sent. Is there a server we can name for the announce list, or some other code to use? How can these two ideas be used together?
One idea is to mark the email URLs with some special code that will override the hot-linking rules (using
RewriteCond). For example, if the normal image URL is:
Then one could probably setup the hosting and rules to allow any of the following to deep link (using a query-string, sub-dir remapping, or host mirroring, respectively):
https://example.com/img/foo.png?deep https://example.com/deepimg/foo.png https://deep.example.com/img/foo.png
This would avoid the need to duplicate images, but one would still need to add “
?deep” to every image URL in the email.