如何防止深层链接到我的网站上的文件 [英] How to prevent deep linking to files on my website

查看:114
本文介绍了如何防止深层链接到我的网站上的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有一个包含大量免费软件的网站。我面临的问题是,来自世界各地的人们正在直接链接
的文件(例如.zip文件)并将它们发布到他们的网站和一般论坛中。我获得了大量的带宽,没关系,但访问的页面数量很少。有没有可以添加到链接的方式或脚本,以便当有人按下来自外国网站的链接时,我的网站上的一个页面会打开,然后让他下载该文件,以便获得更多访问。



例如,这是我网站的地址:


http://sy-stu.org/stu/PublicFiles/StdLibrary/Exam.zip a>


当任何人按下它时,它将直接开始下载过程。

$ _ SERVER ['HTTP_REFERER'] 解释方案 / code>来自您的网站。如果它不是您重定向到您的网站。


I own a website which contain a lot of freeware stuff to download on it. The problem I'm facing is that people from around the world are taking the direct links of the files (for example .zip files) and posting them on their websites and general forums. I am getting a huge amount of bandwidth and that's ok, but the number of pages visited is low. Is there a way or a script that I can add to the links, so that when someone presses on the link from a foreign website, a page from my website opens instead, which then lets him download the file so I can get more visits.

For example, this is a address from my website:

http://sy-stu.org/stu/PublicFiles/StdLibrary/Exam.zip

When anyone presses on it, it will start the downloading process directly.

解决方案

If you are using PHP, you can have a script that links the user to the download but only if the $_SERVER['HTTP_REFERER'] is from your site. If it is not you redirect to your site.

这篇关于如何防止深层链接到我的网站上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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