Hiding Actual download link path

Is there a plugin to hide the actual download link path?
If my actual path is

'/user/folder1/folder2/file.txt'

I wish to show it as

'/download/file.txt'

Hi @duceduc

Maybe something with .htaccess and rewriting rules

Thank. That crossed my mind as well.

Not tried this for download files specifically, but a more Gravvy way would be to use the routes header in user/config/site.yaml. The other benefit of this approach is that it becomes part of your site structure, not an additional tweak to remember, in case you need to move it, store it in git etc.

Now that is a Gravvy idea. I will need to add two different rewrites since I have a test site and a live site that aren’t align with the same path.

My download link is a pdf. How can I have it to download as file and not open in browser?

How the browser handles this is up to the browser and/or the way users configure their browsers. It’s quite appropriate that users can control this themselves.

That said, there are probably fancy Javascript solutions to attempt enforcing what you are talking about.

Yes. There was a php script I used to hide the actual path on a different site (not cms ) and at the same time have the file downloaded and not open in browser. Would be great if I can force have it as download file using grav.

Alright, good luck. The browser handling is not really a Grav question though.