IIS6:禁止下载特定文件扩展名
[我在 serverfault.com 上发布了类似的问题,但反馈很少,所以在这里尝试]
我可以在 Apache 下使用 htaccess 很好地完成此操作。 但在工作中,它一直都是 M$...
我需要锁定对虚拟主机上可能出现的任何 .fla 文件的访问。我们将它们放在我们在某些网站上使用的少数 .swf 旁边,我只是想确保它们不会被可能会抓取网站的人或蜘蛛下载。
fla 中实际上没有任何敏感内容,但我宁愿将它们保存在同一个文件夹中,并禁止下载者下载。
我尝试过 MIME 类型路由(检查 MIME 类型是否在 HTTP Headers > MIME Types 下定义,如果是则删除,等等;),但没有定义 FLA,但我仍然可以默认下载该文件。我记得如果您想要提供 .flv
文件,而不是 .fla
文件,情况恰恰相反,
我无法采用 Web.Config 方法(至少我不这样做)我想我可以)因为它不是 ASP.NET 站点...所以我不确定。
我不想安装任何应用程序(因为这是一个生产系统)。
感谢您的任何反馈。
我的解决方案:
感谢指向正确的方向,我按照我想要的方式工作(希望是正确的),对于也需要此解决方案的人,这就是我所做的:
在下选择您的网站IIS>属性>主目录(选项卡)>配置(按钮)>映射(选项卡)>单击“添加”(按钮)
可执行文件: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
扩展: 此处为您的扩展
动词:(ALL 或 POST/GET/etc;)
[x] 脚本引擎(选中)
[x] Vefiry 文件存在(选中)
[I posted a similar question on serverfault.com, but had very little feedback so trying here]
I can do this just fine under Apache with htaccess.
But at work its all M$ all the time...
I need to lock off access to any .fla files that might come up on a virtual host. We keep them next to the few .swf we use on some of our sites, I just want to be sure they are not being downloaded by people or spiders that may scrape the site.
There isn't really anything sensitive in the fla's but I'd rather keep them in the same folder and have them forbidden to downloaders.
I've tried the MIME type route (check if MIME type is defined under HTTP Headers > MIME Types, remove if it was, etc;), but there is no FLA defined, but I can still download the file by default. I recall this was the opposite if you WANTED to serve .flv
files, but not .fla
's
I cannot do a Web.Config approach (at least I don't think I can) as it is not an ASP.NET site... so I am not sure.
I don't want to install any apps (as this is a production system).
Thanks appreciate any feedback.
MY SOLUTION:
Thanks to being pointed in the right direction, I got this working the way I wanted (hopefully correctly), for anyone needing this solution as well, here is what I did:
Select your website under IIS > Properties > Home Directory (tab) > Configuration (button) > Mappings (tab) > Click Add (button)
Executable: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
Extension: your extension here
Verbs: (ALL or POST/GET/etc;)
[x] Script Engine (checked)
[x] Vefiry file exists (checked)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IIS>网站>属性>主目录选项卡>配置按钮>映射>添加按钮
可执行文件:C:\WINDOWS\system32\inetsrv\404.dll
扩展名:.ext
动词:(不认为这很重要)
[ ] 脚本引擎
[ ] 检查文件是否存在
IIS > Web Site > Properties > Home Directory tab > Configure button > Mappings > Add button
Executable: C:\WINDOWS\system32\inetsrv\404.dll
Extention: .ext
Verbs: (don't think this matters)
[ ] Script engine
[ ] Check that file exists