From our actual static website we have to take over an folder with large downloads to our new kirby website and URL to this download folder (manually maintained) can not be altered as URLs are used by customers over years. Actually the url is : https://my.site.com/downloads/.../...
In our new kirby installation we would like to put the downloads folder at root as:
…
assets
index.php
content
downloads
index.php
kirby
…
How is the correct kirby routes definition in config.php in order that the url https://my.site.com/downloads/.../... points/redirects to the downloads folder and all its files and subfolders? Actuall my routes definition starts with, but I could not figure out which response object should be used in the action function:
in the download folder are files like pds, images, zips etc. for download but also html- and xml-files that should be rendered at their url-position in a “normal” way as for a static site.
Ok, then you need some sort of logic that checks if the file exists in the first place and then returns responses depending on file extension or mime type.
I “resolved” it with Response::download() for all file types (also css etc.) as Response::download() does include mime/type resolving and file exist testing (and more):