拒绝直接URL访问文件 [英] Deny direct url access to files

查看:114
本文介绍了拒绝直接URL访问文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人建议如何只允许从我网站上的网页下载文件,如果有人在浏览器中输入或粘贴直接网址,则拒绝访问?

Does anyone have any suggestions on how to only allow files to be downloaded from pages on my site and deny access if someone types or pastes the direct URL into a browser?

推荐答案

不要直接链接到你的文件,而是链接到php / asp / python /首先检查引用者的脚本。如果引荐来源位于您的域中,请重定向到实际文件。

Instead of making direct link to your files, link to a php/asp/python/whatever script that first checks the referrer. If the referrer is in your domain, redirect to the actual file.

这篇关于拒绝直接URL访问文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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