如何拒绝访问文件,但允许服务器 [英] How To Deny Access To File But Allow Server

查看:370
本文介绍了如何拒绝访问文件,但允许服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有了,里面是多门户配置设置你将多个XML文件的配置文件夹中的Web应用程序。我需要IIS来访问它们因此门户装载(SQL连接字符串,母版页路径),但我想拒绝任何外部访问(网址浏览)。下面是下面一个例子:

I have a web application that has a configuration folder that houses multiple XML files that are configuration settings for multiple "portals" as you will. I need IIS to have access to them so the "portal" loads (sql connection strings, master page paths) but I want to deny any outside access (url browsing). Here's an example below:

HTTP://www.mywebsite/virtualdirectory/configurationdirectory/configfile.xml

我需要限制访问此文件,如果你浏览到它,但仍允许系统访问它,所以它可以解析门户,它的加载。

I need to restrict access to this file if you're browsing to it but still allow the system access to it so it can parse the "portal" that it's loading.

任何想法?

推荐答案

您可以用一个重写规则做到这一点

您也可以使用<一个做到这一点href=\"http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/filteringRules/filteringRule/appliesTo\"相对=nofollow>请求过滤规则

这篇关于如何拒绝访问文件,但允许服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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