is it possible to redirect a link to a pdf file

2019-05-30 03:01发布

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?

标签: web modx
3条回答
祖国的老花朵
2楼-- · 2019-05-30 03:48

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.
查看更多
劳资没心,怎么记你
3楼-- · 2019-05-30 04:00

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

查看更多
爷的心禁止访问
4楼-- · 2019-05-30 04:08

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.

查看更多
登录 后发表回答