当前位置:SEO自学网 > 网站搭建 > 服务器/VPS > windows+iis脚本映射方式实现伪静态(包括asp.net)

windows+iis脚本映射方式实现伪静态(包括asp.net)

admin2022年05月04日 09:59:21服务器/VPS381

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

注意:如果自身已经是aspnet程序,可直接在system.webServer的handlers节中添加相应映射代码,另外还需将程序池切换到经典模式,并开启32兼容脚本映射设置才会生效

如果需要设置全局的通配符映射,直接在控制面板-伪静态设置-.NET通配符映射启用即可

来源:西部数码


扫描二维码推送至手机访问。

版权声明:本文由SEO自学网发布,如需转载请注明出处。

本文链接:http://www.seozixuewang.com/post/3496.html

标签: 伪静态

“windows+iis脚本映射方式实现伪静态(包括asp.net)” 的相关文章

IIS7如何实现ECShop伪静态?2022年05月05日 22:37:39