温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:DotNetNuke04.08.03免安装版项目源码
当前文件路径:DNN/Website/Config/DotNetNuke.config

1<?xml version="1.0"?> 2
<configuration> 3
<!-- The following elements are intended for future consolidation --> 4
<regexfilters /> 5
<compression /> 6
<RewriterRules /> 7
<!-- 8
The blockrequests element contains one or more rules that are used for blocking access to the site. This filter only works 9
on content that is actually processed by ASP.Net. 10
--> 11
<blockrequests> 12
<!-- 13
Each rule element defines a simple matching expression and the action to take if a match is found. You can define as many rules 14
as needed. This provides a flexible "or" operation where any one rule can cause the request to be blocked. 15
Rule Attributes: 16
~~~~~~~~~~~~~~~~ 17
servervar: This is the name of a Server variable from the Request.ServerVar hash table. See: http://www.w3schools.com/asp/coll_servervariables.asp 18
value : Defines the value of the servervar that triggers the rule. For a regex rule, the value should be a regular expression that used as a matching expression. 19
If this is not a regex operation, then value can be a semicolon delimited list of values. For example it could include a list of IP addresses that should 20
be blocked. 21
operator : Defines the operation that determines whether an actual match exists. Valid values: Regex, Equal, NotEqual 22
>> Regex : Uses the regular expression specified in the value attribute to determine a match. 23
>> Equal : Performs a search of the value list to determine if the value of the specified server variable is in the value list. 24
>> NotEqual : Performs a search of the value list to determine if the value of the specified server variable does not exist in the value list. 25
action : Defines the action to take if a match occurs. Valid values: NotFound, Redirect, PermanentRedirect. 26
>> NotFound : Returns a 404 status code and stops all further response processing. 27
>> Redirect : Performs a standard redirect to the url specified in the location attribute. 28
>> PermanentRedirect : Performs a permanent redirect (status code 301) to the url specified in the location attribute. 29
location : The url where the request will be redirected. This can be left blank for the 'NotFound' action. 30
<rule servervar="URL" values="(?i-msnx:.*default\.aspx.*)" operator="Regex" action="Redirect" location="http://www.dotnetnuke.com" /> 31
<rule servervar="HTTPS" values="on" operator="NotEqual" action="NotFound" location="" /> 32
<rule servervar="REMOTE_ADDR" values="10.10.0.100;192.168.0.100" operator="Equal" action="PermanentRedirect" location="http://www.dotnetnuke.com" /> 33
--> 34
</blockrequests> 35
</configuration> 36


