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

<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版本(我司虚拟主机对应路径)

<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" />

原文链接:windows+iis脚本映射方式实现伪静态(包括asp.net) -西部数码帮助中心 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wwwwestcn

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值