is it possible to redirect a link to a pdf file

南笙酒味 提交于 2019-12-08 03:13:22

问题


is it possible to redirect a link to a pdf file?

This is my site: www.mysite.com

And I createad a redirect link that if I open www.mysite.com/documentation - an index.html file will open but for now this index.html file says it's under construction.

Can I redirect the link to a pdf file? I uploaded the pdf file into the server. So that if I open www.mysite.com/documentation, my pdf named as thedocument.pdf will open.

Is it possible?


回答1:


If your web hosting provider won't allow you alter the default extensions (i.e. to add pdf) then you could create a HTML page to act as the landing page and then redirect to the PDF.

Details here: http://www.web-source.net/html_redirect.htm




回答2:


Yes, this is possible. Check your web server configuration that currently points /documentation to index.html, and change it to point to thedocument.pdf.

Be aware that the PDF may or may not load in the user's browser. Some configurations will prompt the user to download the file.




回答3:


You can achieve this with a modX Weblink.

  1. Upload your pdf to a place from where it is publicly downloadable. For this example I will upload it to modx/assets/content/test.pdf. You should now be able to download your file from http://yourdomain.tld/assets/content/test.pdf.
  2. Create a new weblink resource in modX (Site -> New Weblink) on the base level of your resource-tree. Make it a container and type in 'documentation' as the alias of your resource. You should also make sure, that you already use friendly urls, but your question sounds like you're already doing this.
  3. A weblink has a field to enter the 'weblink' instead of the ressource content. Just use the URL from which you are already able to download your pdf-file. In this example, this would be http://yourdomain.tld/assets/content/test.pdf.
  4. If you now view the newly created weblink resource under http://yourdomain.tld/documentation, you should instantly download a copy of your file test.pdf.


来源:https://stackoverflow.com/questions/8726708/is-it-possible-to-redirect-a-link-to-a-pdf-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!