I want people to be able to download several files that sum up lessons I am teaching. Files are pdf organized in folders like this:
.htaccess
01-science/
lesson-1/
notes.pdf
slides.pdf
lesson-2/
notes.pdf
slides.pdf
…
The .htaccess
file already forces files to be downloaded with these commands:
<Files *.pdf>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>
I am giving the direct URL to reach the files, for instance https://lessons.domain.my/01-science/lesson-1/notes.pdf
. But, to avoid confusion, at downloading, I'd like filenames to be prefixed with folder names to give this:
01-science-lesson-1-notes.pdf
01-science-lesson-1-slides.pdf
Maybe a regex in the could do this, but I can't get which one… Thanks for any help!