2008系統(tǒng)需要通過設(shè)置web.config來實現(xiàn)腳本映射功能
設(shè)置參考如下:
只需要設(shè)置腳本影射的目錄下創(chuàng)建web.config文件,其內(nèi)容為
<?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>
紅色字體部分代碼設(shè)置是將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
<add name="html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="File" preCondition="bitness32" />
3.將html后綴的文件映射到php5.2isapi模式,5.2cgi模式,5.3,5.4版本(我司虛擬主機對應(yīng)路徑)
<add name="html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\php_52\php5isapi.dll" resourceType="File" preCondition="bitness32" />
<add name="html" path="*.html" verb="*" modules="CgiModule" scriptProcessor="C:\php_52\php.exe" resourceType="File" preCondition="bitness32" />
<add name="html" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\php_53\php.exe" resourceType="File" preCondition="bitness32" />
<add name="html" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\php_54\php-cgi.exe" resourceType="File" preCondition="bitness32" />
注意:如果自身已經(jīng)是aspnet程序,可直接在system.webServer的handlers節(jié)中添加相應(yīng)映射代碼,另外還需將程序池切換到經(jīng)典模式,并開啟32兼容腳本映射設(shè)置才會生效
如果需要設(shè)置全局的通配符映射,直接在控制面板-偽靜態(tài)設(shè)置-.NET通配符映射啟用即可