After googling I didn't find answer to my question.
So, question.
I have site with http://www.emathhelp.net
Inside it there is folder with pdf files.
I want to restrict direct access to pdf files, so http://www.emathhelp.net/1/3192849.pdf will return error, but a page with code
<object data="pdf/1/3192849.pdf"></object>
will correctly fetch pdf.
One of the attempts was to redirect all urls that end with .pdf to php script which then will find the page where pdf is embedded and redirect there. It was done, however inside <object></object>
there is black screen, because I guess data="pdf/1/3192849.pdf"
is rewritten also an thus infinite loop is created.
Can you help me?
Maybe there are some solutions through .htaccess, maybe I don't need to use <object>
.
Please, write your suggestions.