I read your message again, and while I now understand the issue you had by looking at the solution, I can with complete confidence tell you that I would have never guessed that this would have been the solution to the issue you had.
And to be honest, regarding the question “different .htaccess per page”, the code you have just applies this check to all URLs in the directory. So there is absolutely no different .htaccess per page there.
So I’m glad that you were able to solve it, because I wouldn’t have been able to with the vague description you have provided.
Please note that hotlinking is not supported on our hosting by default, due to this system:
Whether the solution you have works as intended depends on the exact use case, which I don’t fully understand. However, you should know that referrer headers are very easily to manipulate, and may not do much for “security” to begin with.