<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <connectionStrings>
        <add name="NTPC_Tel_Err_ConnectionString" connectionString="Data Source=172.18.12.87;Initial Catalog=PWB_SLMMS1;Persist Security Info=True;User ID=PWB_SLMMS1_USR;Password=AS9307_5412564T" providerName="System.Data.SqlClient" />
        <!-- <add name="NTPC_Tel_Err_ConnectionString" connectionString="Data Source=172.18.16.92;Initial Catalog=NTPC;Persist Security Info=True;User ID=NTPC;Password=^Bw?NTPC" providerName="System.Data.SqlClient" /> -->
        <!-- <add name="NTPC_Tel_Err_ConnectionString" connectionString="Data Source=172.18.33.62;Initial Catalog=NTPC;Persist Security Info=True;User ID=NTPC;Password=^Bw?NTPC" providerName="System.Data.SqlClient" /> -->

        <add name="NTPCConnectionString" connectionString="Data Source=172.18.12.87;Initial Catalog=PWB_SLMMS1;Persist Security Info=True;User ID=PWB_SLMMS1_USR;Password=AS9307_5412564T" providerName="System.Data.SqlClient" />
        <!-- <add name="NTPCConnectionString" connectionString="Data Source=172.18.12.98;Initial Catalog=PWB_SLMMS1TEST;Persist Security Info=True;User ID=PWB_SLMMS1TEST_USR;Password=AS9307_741K65262S" providerName="System.Data.SqlClient" /> -->

        <!-- <add name="NTPCConnectionString" connectionString="Data Source=172.18.33.62;Initial Catalog=NTPC;Persist Security Info=True;User ID=NTPC;Password=^Bw?NTPC" providerName="System.Data.SqlClient" /> -->
        <add name="CPCConnectionString" connectionString="Data Source=172.18.33.62;Initial Catalog=CMMNTY;Persist Security Info=True;User ID=cpc;Password=cpc@pcals" providerName="System.Data.SqlClient" />

        <!-- <add name="NTPCConnectionString" connectionString="Data Source=172.18.16.92;Initial Catalog=NTPC;Persist Security Info=True;User ID=NTPC;Password=^Bw?NTPC" providerName="System.Data.SqlClient" /> -->
        <!-- <add name="CPCConnectionString" connectionString="Data Source=172.18.16.92;Initial Catalog=CMMNTY;Persist Security Info=True;User ID=cpc;Password=cpc@pcals" providerName="System.Data.SqlClient" /> -->
    </connectionStrings>
    <system.web>
        <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="300" timeout="600" />
        <pages enableEventValidation="false" viewStateEncryptionMode="Always" />
        <!--
            設定 compilation debug="true" 會將偵錯
            符號插入編譯過的頁面。因為這樣會
            影響效能，所以只有在開發期間才能將
            這個值設定為 true。
        -->
        <httpRuntime enableVersionHeader="false" maxRequestLength="50000" />
        <compilation debug="false" defaultLanguage="c#">
            <assemblies>
                <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            </assemblies>
        </compilation>
        <!--
            <authentication> 區段可以用來設定 ASP.NET
            使用的安全性驗證模式，以識別連入的
            使用者。
        -->
        <authentication mode="Windows" />
        <!--
            <customErrors> 區段可以用來設定
            在執行要求期間發生未處理
            錯誤時所要執行的動作。具體來說，
            它可以讓開發人員設定要顯示的 HTML 錯誤網頁，
            以取代錯誤堆疊追蹤。

        <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" />
        <!-- <globalization fileEncoding="utf-8" culture="zh-TW" uiCulture="zh-TW" />-->

        <!--
            Off : 開發人員看細節
            On : 不顯示詳細錯誤細節
            RemoteOnly : 設定遠端看到的
        -->
        <customErrors mode="On" />

		<!-- Add the SameSite attribute to all cookies. Starting February 2020, the Chrome browser made SameSite a mandatory attribute for all cookies. Any cookie without the SameSite attribute is either rejected or treated with the default behaviour, which is the same as setting the attribute value to Lax. Therefore, any cookie that must be sent regardless the origination of the request (for example, analytics cookies) should have the SameSite attribute value of none. -->
		<!-- Furthermore, we recommend that developers continue to add traditional CSRF mitigations to the site along with SameSite attribute. Many site users might still use older browser versions to access the site. Older browser versions do not understand the SameSite attribute. -->
		<!-- <httpCookies sameSite="Lax" requireSSL="true" /> -->
    </system.web>
    <appSettings>
        <add key="CTitle" value="路燈管理系統" />
        <add key="UpLoadPath" value="D:\Inetpub\SLNTPC\SLImage\" />
        <add key="UpLoadPath1" value="D:\Inetpub\SLNTPC\MTImage\" />
        <add key="UpLoadPath2" value="D:\Inetpub\SLNTPC\OrdCheck\" />
        <add key="UpLoadPath3" value="D:\Inetpub\SLNTPC\SpotCheck\" />
        <add key="UpLoadPath4" value="D:\Inetpub\SLNTPC\MSImage\" />
        <add key="UploadPath5" value="D:\Inetpub\SLNTPC\MSLImage\" />
        <add key="UpLoadPath6" value="D:\Inetpub\SLNTPC\CrackImage\" />
        <add key="UpLoadPath7" value="D:\Inetpub\SLNTPC\Guard\" />
        <add key="UpLoadPath8" value="D:\Inetpub\SLNTPC\PwBoxImage\" />
        <add key="UpLoadPath9" value="D:\Inetpub\SLNTPC\CompDaily\" />
        <add key="UpLoadPath10" value="D:\Inetpub\SLNTPC\GuardDaily\" />
        <add key="UpLoadPath11" value="D:\Inetpub\SLNTPC\Voice\" />
        <add key="UpLoadPath12" value="D:\Inetpub\SLNTPC\ErrorImage\" />
        <add key="UpLoadPath13" value="D:\Inetpub\SLNTPC\DownLoadData\" />
        <add key="UpLoadPathCPC" value="D:\CPC\WEB\NTCPEMS\FileData\LED0010\" />
        <add key="UpLoadPath0" value="D:\Inetpub\SLNTPC\" />
        <add key="sysSMTP" value="msa.hinet.net" />
        <add key="ErrMail" value="mark228@ms49.hinet.net" />
        <add key="PFIService.WorkOrder" value="http://streetlight.ntpc.gov.tw/ntcpems/SERVICE/WorkOrder.asmx" />
        <add key="NTPCPARKService.service" value="http://parkfacilities.ntpc.gov.tw/ntpcpark/service.asmx" />
        <add key="aspnet:MaxHttpCollectionKeys" value="5000" />
    </appSettings>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="default.aspx" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="iisstart.htm" />
            </files>
        </defaultDocument>
        <security>
            <requestFiltering>
                <verbs>
                    <add verb="OPTIONS" allowed="false" />
                </verbs>
            </requestFiltering>
        </security>
        <httpProtocol>
            <customHeaders>
                <!-- 以下直接繼承 %SystemRoot%\System32\inetsrv\config\applicationHost.config -->
                <!-- <remove name="Cache-Control" /> -->
                <!-- <remove name="X-UA-Compatible" /> -->
                <!-- <remove name="X-Frame-Options" /> -->
                <!-- <remove name="X-XSS-Protection" /> -->
                <!-- <remove name="X-Content-Type-Options" /> -->
                <!-- <remove name="Content-Security-Policy" /> -->
                <!-- <remove name="X-Powered-By" /> -->
                <!-- <add name="Cache-Control" value="no-cache" /> -->
                <!-- <add name="X-UA-Compatible" value="IE=edge" /> -->
                <!-- <add name="X-Frame-Options" value="SAMEORIGIN" /> -->
                <!-- <add name="X-XSS-Protection" value="1; mode=block" /> -->
                <!-- <add name="X-Content-Type-Options" value="nosniff" /> -->
                <!-- <add name="Content-Security-Policy" value="frame-ancestors &apos;self&apos;" /> -->
            </customHeaders>
        </httpProtocol>
        <!-- <httpRedirect enabled="false" destination="172.18.33.62" exactDestination="false" childOnly="true" /> -->
        <rewrite>
            <rewriteMaps>
                <rewriteMap name="/Default.aspx" />
                <rewriteMap name="/EroNew.aspx" />
                <rewriteMap name="/seecode.aspx" />
                <rewriteMap name="/Mobile.aspx?SLSN=" />
                <rewriteMap name="/Mobile.aspx" />
                <rewriteMap name="/FosterList.aspx" />
            </rewriteMaps>
            <rules>
                <remove name="301重新導向規則 針對 /Default.aspx" />
                <remove name="301重新導向規則 針對 /EroNew.aspx" />
                <remove name="301重新導向規則 針對 /seecode.aspx" />
                <remove name="301重新導向規則 針對 /Mobile.aspx?SLSN=" />
                <remove name="301重新導向規則 針對 /Mobile.aspx" />
                <remove name="301重新導向規則 針對 /FosterList.aspx" />
                <rule name="301重新導向規則 針對 /Default.aspx" stopProcessing="true">
                    <match url="^($|Default\.aspx)" ignoreCase="true" />
                    <action type="Redirect" url="https://{SERVER_NAME}/SL2019/" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="301重新導向規則 針對 /EroNew.aspx" stopProcessing="true">
                    <match url="^EroNew\.aspx" ignoreCase="true" />
                    <action type="Redirect" url="https://{SERVER_NAME}/SL2019/Contents_Share/FAL_Repair/" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="301重新導向規則 針對 /seecode.aspx" stopProcessing="true">
                    <match url="^seecode\.aspx" ignoreCase="true" />
                    <action type="Redirect" url="https://{SERVER_NAME}/SL2019/Contents_Share/FAL_Repair/" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="301重新導向規則 針對 /Mobile.aspx?SLSN=" stopProcessing="true">
                    <match url="^Mobile\.aspx" ignoreCase="true" />
					<conditions>
                        <add input="{QUERY_STRING}" pattern="^(?:.*&amp;)?SLSN=(.*?)(?:&amp;|$)" />
					</conditions>
                    <action type="Redirect" url="https://{SERVER_NAME}/SL2019/Contents_Share/FAL_Repair/#/?SLSN={C:1}" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="301重新導向規則 針對 /Mobile.aspx" stopProcessing="true">
                    <match url="^Mobile\.aspx" ignoreCase="true" />
                    <action type="Redirect" url="https://{SERVER_NAME}/SL2019/Contents_Share/FAL_Repair/" appendQueryString="false" redirectType="Permanent" />
                </rule>
                <rule name="301重新導向規則 針對 /FosterList.aspx" stopProcessing="true">
                    <match url="^FosterList\.aspx" ignoreCase="true" />
                    <action type="Redirect" url="https://{SERVER_NAME}/SL2019/Contents_Share/SLF_MENU/" appendQueryString="false" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>