<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <connectionStrings />
  <system.web>
    <httpRuntime maxRequestLength="1024000" requestValidationMode="2.0" />
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.JScript, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
    <authentication mode="Windows" />
    <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    <customErrors defaultRedirect="404.htm" mode="On">
      <error statusCode="403" redirect="404.htm" />
      <error redirect="https://www.witbee.com.cn/m" statusCode="404" />
    </customErrors>
    <pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
  </system.web>
  <appSettings>
    <!--Connect To MSSQL Database-->
    <add key="Server" value="." />
    <add key="Database" value="witbee" />
    <add key="UID" value="witbee" />
    <add key="PWD" value="eFe%hT8!4!S8" />
    <!--End-->
  </appSettings>
  <system.webServer>
	  <rewrite>
		  <rules>

			  <rule name="IIS_301" stopProcessing="true">
				  <match url=".*" />
				  <conditions>
					  <add input="{HTTP_HOST}" pattern="^witbee.com.cn$" />
					
				  </conditions>
				  <action type="Redirect" url="https://www.witbee.com.cn/{R:0}"
				  redirectType="Permanent" />
			  </rule>


			  <rule name="IIS_301_2" stopProcessing="true">
				  <match url=".*" />
				  <conditions>
					  <add input="{HTTP_HOST}" pattern="^m.witbee.com.cn$" />
				  </conditions>
				  <action type="Redirect" url="https://www.witbee.com.cn/{R:0}"
				  redirectType="Permanent" />
			  </rule>

			  <rule name="HTTP to HTTPS redirect" stopProcessing="true">
				  <match url="(.*)" />
				  <conditions>
					  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
					  <add input="{HTTP_HOST}" pattern="^m.witbee.com.cn$" negate="true" />
				  </conditions>
				  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
			  </rule>
			 
		  </rules>
	  </rewrite>
	  <defaultDocument>
      <files>
        <clear />
        <add value="index.html" />
        <add value="index.aspx" />
        <add value="default.aspx" />
        <add value="default.html" />
      </files>
    </defaultDocument>
    <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="font/x-font-woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
    </staticContent>
        <httpErrors>
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="https://www.witbee.com.cn/" responseMode="Redirect" />
        </httpErrors>
  </system.webServer>
</configuration>