您的位置:主页 > 重定向 >

重定向 IIS的web.config实现正规则批量301跳转

2019-10-24作者:纪涛博客来源:68up.com次阅读

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.shtml" responseMode="ExecuteURL" />
</httpErrors>
<rewrite>

<rules>
<rule name="Redirect" stopProcessing="true">
<match url="^articlel-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=71?sdal-cn-article" />
</rule>

<rule name="Redirect2" stopProcessing="true">
<match url="^detail-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=73?sdal-cn-detail" />
</rule>
	
	
	<rule name="Redirect3" stopProcessing="true">
<match url="^lvjia-articlel-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/category.php?id=858?sdal-cn-lvjia-articlel" />
</rule>
	
	<rule name="Redirect4" stopProcessing="true">
<match url="^product-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/category.php?id=858?sdal-cn-product" />
</rule>
	
	<rule name="Redirect5" stopProcessing="true">
<match url="^list-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/category.php?id=858?sdal-cn-list" />
</rule>
	
	<rule name="Redirect6" stopProcessing="true">
<match url="^company.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=71?sdal-cn-company" />
</rule>
	
		
	<rule name="Redirect7" stopProcessing="true">
<match url="^contact.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=88?sdal-cn-contact" />
</rule>

<rule name="Redirect8" stopProcessing="true">
<match url="^article-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="/err.html" />
</rule>

<rule name="Redirect9" stopProcessing="true">
<match url="^factory-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=73?sdal-cn-factory" />
</rule>

<rule name="Redirect10" stopProcessing="true">
<match url="^test-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=73?sdal-cn-test" />
</rule>

<rule name="Redirect11" stopProcessing="true">
<match url="^case-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=149?sdal-cn-case" />
</rule>

<rule name="Redirect12" stopProcessing="true">
<match url="^news-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=150?sdal-cn-news" />
</rule>

<rule name="Redirect13" stopProcessing="true">
<match url="^info-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=150?sdal-cn-info" />
</rule>

<rule name="Redirect14" stopProcessing="true">
<match url="^baike-([A-Za-z0-9-]*).html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=115?sdal-cn-baike" />
</rule>
	
	<rule name="Redirect15" stopProcessing="true">
<match url="^Custom-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=115?sdal-cn-Custom" />
</rule>

<rule name="Redirect16" stopProcessing="true">
<match url="^support-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=88?sdal-cn-support" />
</rule>

<rule name="Redirect17" stopProcessing="true">
<match url="^service-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/article.php?id=88?sdal-cn-service" />
</rule>

<rule name="Redirect18" stopProcessing="true">
<match url="^answer-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://test.com/category.php?id=3?sdal-cn-answer" />
</rule>


<rule name="Redirect19" stopProcessing="true">
<match url="^mount-1.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="/err.html?sdal-cn-mount" />
</rule>

	</rules>
</rewrite>
</system.webServer>
</configuration>

 

如上;

凡本站注明“本站”或“投稿”的所有文章,版权均属于纪涛博客或投稿人,未经本站授权不得转载、摘编或利用其它方式使用上述作品。本站已授权使用的作品,应在授权范围内使用,并注明“来源:纪涛博客”并附上链接。违反上述声明者,本站将追究其相关法律责任。

编辑:68up.com 关键词:

网友评论

随机推荐

图文聚集

热门排行

最新文章

新浪微博 腾讯微博 RSS订阅