Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Hiding Actual download link path

Started by Duc 8 years ago · 7 replies · 984 views
8 years ago

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

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

I wish to show it as

TXT
'/download/file.txt'
8 years ago

Hi @duceduc

Maybe something with .htaccess and rewriting rules

8 years ago

Thank. That crossed my mind as well.

8 years ago

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.

8 years ago

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?

8 years ago

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.

8 years ago

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.

8 years ago

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

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 82 12 hours ago
General · by pamtbaau, 17 hours ago
1 55 16 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 348 5 days ago
General · by Duc , 5 days ago
3 43 5 days ago