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.

Support

Routes link to external file

Started by Andre Allin 8 years ago · 4 replies · 480 views
8 years ago

Is it possible to chain link to file? I have website, where one item in footer menu is linking to pdf file, but client want it to link on certain url (like a mysite.com/cs/gdpr), I think it's somehow possible with routes configuration, but am unable to make it work ...

here's my site.yaml conf routes section

routes:
/cs/gdpr: '/download/GDPR_OKTOURS_CZ.pdf'
/en/gdpr: '/download/GDPR_OKTOURS_EN.pdf'

whats wrong with it,
whats wrong with me?

my pages structure is like
user/pages/download/GDPR_OKTOURS_CZ.pdf

=]

8 years ago

Hi - I'm sure there's nothing wrong with you 🙂

Can you tell us how it is not working? What happens when you request the rerouted URLs? 404? Can you access the PDF URLs in the download folder directly (e.g. http://example.com/download/GDPR_OKTOURS_EN.pdf) ?

8 years ago

yes, 404
and yes I can access the file when I put absolute uri to browser.

8 years ago

Well, it seems neither redirect approach is working
i have my alias like a
/cs/gdpr ... and redirect /download/file.pdf

but it throws 404 again

8 years ago

well, as Chemical Brothers sing...

how and why,
did I die?

but thats not my case fortunately, I've somehow managed to redirect the link to pdf file...

site.yaml:

redirects:
/gdpr: 'http://www.example.com/download/GDPR_OKTOURS_CZ.pdf[301]'

but now comes harder part!

I don't know how to redirect it to another language since, rules of redirect as written in manual work only after lang/slash ...

I'm so close, desperately seeking for help.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 56 14 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 6 days ago