Molet

Windows2008/IIS7/使用web.config跳转及404图片/伪静态跳转

Molet IIS 2018-05-05 2313浏览 0

web.config内容如下

需要调用伪静态才可以使用

命令格式和伪静态格式相同

Rule名字记得自行修改。所有的rule名称不能重复


<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<system.webServer>

<rewrite>

<rules>

 

<rule name="011 Redirect" stopProcessing="true">      <!—名字要不同-->

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^www.xxxxxx.cn" /><!--需要跳转域名-->

</conditions>

<action type="Redirect" url="http://www.xxx.com/{R:0}" redirectType="Permanent" /><!--跳转到的域名-->

</rule>

 


 

</rules>

</rewrite>

        <httpErrors errorMode="Custom" existingResponse="Replace"><!—404方式-->

            <remove statusCode="404" subStatusCode="-1" />

            <error statusCode="404" path="404.htm" responseMode="File" /><!—路径不同自行修改-->

        </httpErrors>


</system.webServer>

</configuration>


继续浏览有关 伪静态 的文章
发表评论