<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- 注册 UrlRewrite.Rules 区域 -->
  <configSections>
    <section name="UrlRewriteConfig" type="UrlRewrite.UrlRewriteConfigSerializerSectionHandler, UrlRewrite" />
  </configSections>
  <!-- 
  UrlRewrite.Rules 区域 （为什么 ActivePageMenuName={1} 而不是 {0}，因为第一个 Group 是全部，第二个 Group 才是真正的第一个，就是说， Match Group 基于 1） 
  如果要使用 htm 后缀的 rewrite，则需要在 IIS 中把后缀为.html的文件的解析器设为.net解析. （IIS管理器+web站点+右键属性+主目录+配置+添加一个和.aspx类似的解析就行了） "
  本系统在 Menu.PropertyInit() 中，对 Url 为 GetKnowledge.aspx 的 PageMenu 进行 Url Rewrite 处理，这样 Render 出来的页面包含静态导航地址，便于搜索引擎索引
  -->
  <UrlRewriteConfig>
    <UrlRewriteRules>
      <!-- 用于首页语种转换 -->
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/Default.aspx</RequestUrl>
        <RewriteUrl>Default.aspx?Culture={1}</RewriteUrl>
      </UrlRewriteRule>
      <!-- 以下 Entry 用于显示单个内容 （在 KnowledgeGet.cs 中 Title Url 链接）（该 Entry 中 PrintFriendly 自动为 false，除非明确设置了 PrintFriendly=true） -->
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)_k(\d+)_cp(\d+)\.aspx\?PrintFriendly\=([a-zA-Z]+)</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;KnowledgeID={3}&amp;CommentsCurrentPage={4}&amp;PrintFriendly={5}</RewriteUrl>
      </UrlRewriteRule>
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)_k(\d+)\.aspx\?PrintFriendly\=([a-zA-Z]+)</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;KnowledgeID={3}&amp;PrintFriendly={4}</RewriteUrl>
      </UrlRewriteRule>
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)_k(\d+)_cp(\d+)\.aspx</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;KnowledgeID={3}&amp;CommentsCurrentPage={4}&amp;PrintFriendly=false</RewriteUrl>
      </UrlRewriteRule>
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)_k(\d+)\.aspx</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;KnowledgeID={3}&amp;PrintFriendly=false</RewriteUrl>
      </UrlRewriteRule>
      <!-- 以下四个 Entry 用于绝大部分内容页 -->
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)_(\d+)\.aspx\?PrintFriendly\=([a-zA-Z]+)</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;CurrentPage={3}&amp;PrintFriendly={4}</RewriteUrl>
      </UrlRewriteRule>
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)_(\d+)\.aspx</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;CurrentPage={3}</RewriteUrl>
      </UrlRewriteRule>
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)\.aspx\?PrintFriendly\=([a-zA-Z]+)</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}&amp;PrintFriendly={3}</RewriteUrl>
      </UrlRewriteRule>
      <UrlRewriteRule>
        <RequestUrl>content\/([^\/]+)\/(.+)\.aspx</RequestUrl>
        <RewriteUrl>GetKnowledge.aspx?Culture={1}&amp;ActivePageMenuName={2}</RewriteUrl>
      </UrlRewriteRule>
    </UrlRewriteRules>
  </UrlRewriteConfig>
  <system.web>
    <!--  DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to enable ASPX debugging.  Otherwise, setting this value to
          false will improve runtime performance of this application. 
          Set compilation debug="true" to insert debugging symbols (.pdb information)
          into the compiled page. Because this creates a larger file that executes
          more slowly, you should set this value to true only when debugging and to
          false at all other times. For more information, refer to the documentation about
          debugging ASP .NET files.
    -->
    <!--
    <compilation debug="true" />
    -->
    <!--  CUSTOM ERROR MESSAGES
          Set customError mode values to control the display of user-friendly 
          error messages to users instead of error details (including a stack trace):

          "On" Always display custom (friendly) messages  
          "Off" Always display detailed ASP.NET error information.
          "RemoteOnly" Display custom (friendly) messages only to users not running 
          on the local Web server. This setting is recommended for security purposes, so 
          that you do not display application detail information to remote clients.
    -->
    <customErrors mode="Off" />
    <!--  AUTHENTICATION 
          This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", 
          "Passport" and "None"
    -->
    <!--authentication mode="Forms">    
		<forms loginUrl="login.aspx" name="AuthCookie" timeout="60" path="/">
		</forms>		
	</authentication-->
    <authentication mode="Windows" />
    <!--authentication mode="Forms" /-->
    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every page within an application. 
          Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
          trace information will be displayed at the bottom of each page.  Otherwise, you can view the 
          application trace log by browsing the "trace.axd" page from your web application
          root. 
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <!--  SESSION STATE SETTINGS
          By default ASP .NET uses cookies to identify which requests belong to a particular session. 
          If cookies are not available, a session can be tracked by adding a session identifier to the Url. 
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="20" />
    <!--  GLOBALIZATION
          This section sets the globalization settings of the application. 
    -->
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    <!-- 页面运行时间最长设定为 90 分钟（5400秒），最大上载尺寸为 100M -->
    <httpRuntime executionTimeout="5400" maxRequestLength="102400" />
    <!-- 用 Http Modules 进行 Url Rewrite 用于 IIS6 或 IIS6- 或 IIS7 经典（Classic）模式-->
    <pages validateRequest="false" />
  </system.web>
  <!-- 在 IIS7 Intergrated （集成）模式或 II7+, 换成以下代码，而将上面的 system.web 中的对应的 <httpModules>...</httpModules> 部分去掉  -->
  <!--
  <system.webServer>
    <modules>
      <add type="UrlRewrite.UrlRewriteModule,UrlRewrite" name="UrlRewrite" />
    </modules>
  </system.webServer>
  -->
  <!-- 程序设置区域 -->
  <appSettings>
    <add key="BuiltInConnectionString" value="" />
    <add key="SqlCommandTimeout" value="600" />
    <add key="TinyMceDelay" value="2" />
    <add key="SetupDate" value="" />
    <add key="User" value="" />
    <add key="Organization" value="" />
    <add key="SerialNumber" value="" />
  </appSettings>
</configuration>