Couldn't quite find a specific answer to this. Imagine a web page that has links to some PDF files: mysite.com/folder/page-with-links.html. The files that are linked to are in a directory at mysite.com/files/.

Is it possible—via .htaccess—to prevent anyone viewing files in the file directory unless they do so by clicking a link on the page-with-links.html page? (For example, is there a way to prevent someone accessing a file by entering a URL in their browser like mysite.com/files/file1.pdf?)

Or perhaps there's a better way. A client has a member-only section of their site that links to sensitive files, and I'm trying to make sure a non-member (such as Google) can't get hold of a file URL and use it to access files stored in publicly accessible directories.