I have a basic folder structure like this:
index.php
assets/
docs/
document.pdf
includes/
script.php
I need to be able to block access to the document if someone was to try and get it directly, for example: www.domain.com/assets/docs/document.pdf
but allow access if was to be linked from the index.php page.
Would there be a way I can block access like this, or, is there a method of embedding the pdf on the page? I'm open to using PHP or jQuery if it can be done through that as well.
Some of the methods I have tried have been including deny restrictions in the htaccess but then that obviously blocks it altogether.
Thanks in advance.