Link to file in sitemap

Permalink
I'm pretty sure this is not possible, just thought I'd ask.

Would it be possible to add a direct link to a file within the sitemap tree? Bad usability to link directly to a PDF from a menu navigation, but for a small intranet site I'm working on it would actually be very nice. I know I can add an external link and just copy the URL to the file, the disadvantage to doing that however is if the file ever gets updated in the File Manager this external link won't reflect that change.

Anyone do something like this before?

hursey013
 
globalnerds replied on at Permalink Reply
globalnerds
I don't think this is possible, however you could do a redirect in your .htaccess file:

If the page in the sitemap was

http://www.mysite.com/thispage

you would put the following in the .htacces file

redirect 301 /thispage http://www.mysite/path-to-pdf/my.pdf...

Anytime someone clicks on the link for that page, it would redirect to the pdf.
jordanlev replied on at Permalink Reply
jordanlev
I think the external link is the best way to go. And I believe if you replace the file in the file manager, the link will still stay the same (files are versioned so even a new version of a file will maintain the same overall file id -- in other words, as long as you do the "Replace" operation instead of deleting and re-uploading a new one, you should be fine).
hursey013 replied on at Permalink Reply
hursey013
Thanks Jordan - what would the proper URL structure be for linking to the file in an external link to always pull the latest version? I don't want the one in the file properties in the file manager (http://www.some.org/files/1613/1913/3099/my.pdf) right? So would I use the download link (http://www.some.org/index.php/download_file/-/view/41/) or is there another way to just reference the fID besides those options?
jordanlev replied on at Permalink Reply
jordanlev
I believe it's the latter of your two examples. But I'm not 100% sure because I've never done this myself. Don't be afraid to experiment -- just try out the various options and see what works, and then report back and let us know for future posterity.
hursey013 replied on at Permalink Reply
hursey013
Just used this format:
/download_file/1/
within the external link URL field. Substitute "1" with whatever the fID is. Advantage of this is it will always download the latest version of the file, disadvantage is it forces a download instead of opening up directly in compatible browsers - don't know if there's any way to accomplish that without a direct link to the actual file.
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Try this:
/download_file/view_inline/1/
hursey013 replied on at Permalink Reply
hursey013
Thats what I was looking for, thanks.