您可以通过Apache下载文件吗? [英] Can you make a file downloadable through Apache?

查看:80
本文介绍了您可以通过Apache下载文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

路径= /var/lib/foo.txt

是否可以配置Apache,以便有一些HTTP URL可以启动此文件的下载,如何进行?没有 .htaccess 文件.

Is it possible to configure Apache so there would be some HTTP URL that would initiate a download of this file and how? Without .htaccess file.

那么该URL是什么? localhost/var/lib/foo.txt ?

And what would that URL be then? localhost/var/lib/foo.txt?

推荐答案

就像在您的apache配置中添加一个别名指令一样简单.

It's as simple as adding an alias directive within your apache config.

Alias '/bar' '/path/to/foo'

然后,您将通过 http://example.com/bar 之类的资源公开访问资源.

Then you'd access the resource publicly via something like http://example.com/bar.

这篇关于您可以通过Apache下载文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆