web.config是win主机及asp空间使用的跳转语言,那如何实现子域名或目录301到主域名呢?以下有几种写法,希望对大家做域名跳转有帮助:
目录进行主域名跳转操作
<rule name="301" stopProcessing="true">
<match url="^3g/(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="http://你的域名/{R:1}"/>
</rule>
子域名进行301跳转操作
<rule name="www" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false"/>
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^m.你的域名$"/>
</conditions>
<action type="Redirect" url="http://你的域名/{R:1}" redirectType="Permanent"/>
</rule>
当然,更多操作方式还是需要自已了解和实践!
备注:部分网站模板整理自网络,如有侵权,请及时与我们沟通处理。
如若看不到文章内容及下载地址,注册免费会员既可。
更多好看的企业SDCMS模板可加QQ群:

读完这篇文章后,您心情如何?