I would like to know how a full pathname call for a pdf can be served showing only the enclosing folder URL. This is for keeping the URLs minimal while doing some logging.
The file structure for each in a series of documents is (example):
/mysite.com/docs/doc-4-5/
index.php
document-4-5.pdf
The index does some logging, then redirects:
doLogging();
header('Location:document-4-5.pdf');
This works. A call to the folder returns the pdf. But the return URL includes the pdf's full pathname, and I would like it to show only the enclosing folder name, so when you get the pdf, the URL you see is (example):
/mysite.com/docs/doc-4-5/
Thus, refresh calls for the pdf, or any full pathname call to it, will always go through the index.
It seems this can be done with redirect, but I have not been able to do it, and will appreciate guidance.
Thank you.