下载文件夹的 Apache 热链接保护
我试图避免从其他网站直接链接到我网站的可下载内容。
我的 exe、zip 和 msi 文件位于 /files 目录下。我怎样才能避免直接链接到它们?
提前致谢...
I'm trying to avoid direct links from other sites to my site's downloadables.
My exe,zip and msi files are under /files directory. How can I avoid direct links to them?
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下内容添加到 /files 目录中的 .htaccess 文件中
将“mysite.com”更改为您的域,将 /images/nohotlink.jpg 更改为您希望显示的图像,告诉用户不允许热链接。
有关更多详细信息,请查看:
http://altlab.com/htaccess_tutorial.html
Add the following to a .htaccess file in your /files directory
Change "mysite.com" to your domain and /images/nohotlink.jpg to an image you wish to display telling users hotlinking is not allowed.
For more detailed information check out:
http://altlab.com/htaccess_tutorial.html