天天看點

windows+iis腳本映射方式實作僞靜态(包括asp.net)

一 . Windows2008、2012或更高系統

      隻需要在設定腳本影射的目錄下建立web.config檔案,其内容為

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <handlers>           
             <add name="ttt-map" path="*.ttt" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="File" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
        </handlers>
    </system.webServer>
</configuration>      

   注意: name="ttt-map" 所在行代碼設定是将ttt字尾的檔案映射到aspnet4.0或aspnet4.5,path="*.ttt"部分請自行按需求修改.

二 . 其他示例:

    1.将html字尾的檔案映射到aspnet2.0或aspnet3.5

<add name="html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="File" preCondition="classicMode,runtimeVersionv2.0,bitness32" />      

    2.将html字尾的檔案映射到asp

    3.将html字尾的檔案映射到php5.2isapi模式,5.2cgi模式,5.3,5.4版本

原文連結:windows+iis腳本映射方式實作僞靜态(包括asp.net) -西部數位幫助中心