关于在Webconfig中定义301重定向时正则表达式如何写
我原来是在web.config中定义了每一个网址的重定向去向,但是超过了1000左右重定向就出现错误了,但是我要重定向的页面有3000多个,但是这些文件目录下只有部分文件需要重定向,因此不能用目录重定向的方式。我原来的方法如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="17276" stopProcessing="true">
<match url="^cs_17276.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://www.xxx.com/xxx/h/17276.html" redirectType="Permanent"/>
</rule>
<rule name="17271" stopProcessing="true">
<match url="^cs_17271.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://math.xxx.com/xxx/h/17271.html" redirectType="Permanent"/>
</rule>
...
</rules>
</rewrite>
</system.webServer>
</configuration>
我需要实现一个目录下某些文件定向到相应的网站去,在webconfig里的一个rule中如何用正则表达式来写呢?
如:
1、cs_17276.html、cs_17286.html、cs_17476.html...。分别定向到:https://www.xxx.com/xxx/h/17276.html、https://www.xxx.com/xxx/h/17286.html、https://www.xxx.com/xxx/h/17476.html
2、cs_17273.html、cs_17282.html、cs_17471.html...。分别定向到:https://www.xxx.com/xxx/w/17273.html、https://www.xxx.com/xxx/w/17282.html、https://www.xxx.com/xxx/w/17471.html
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="17276" stopProcessing="true">
<match url="^cs_17276.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://www.xxx.com/xxx/h/17276.html" redirectType="Permanent"/>
</rule>
<rule name="17271" stopProcessing="true">
<match url="^cs_17271.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="https://math.xxx.com/xxx/h/17271.html" redirectType="Permanent"/>
</rule>
...
</rules>
</rewrite>
</system.webServer>
</configuration>
我需要实现一个目录下某些文件定向到相应的网站去,在webconfig里的一个rule中如何用正则表达式来写呢?
如:
1、cs_17276.html、cs_17286.html、cs_17476.html...。分别定向到:https://www.xxx.com/xxx/h/17276.html、https://www.xxx.com/xxx/h/17286.html、https://www.xxx.com/xxx/h/17476.html
2、cs_17273.html、cs_17282.html、cs_17471.html...。分别定向到:https://www.xxx.com/xxx/w/17273.html、https://www.xxx.com/xxx/w/17282.html、https://www.xxx.com/xxx/w/17471.html
...全文
相关推荐
MSDNURLRewriting netURL重写模块
URL重写模块,微软官方下载,运行稳定可靠,只需要通过简单的配置即可实现URL重写功能,非常强大实用,如果你还没有开始伪静态的学习,现在开始吧
ISAPI_Rewrite3_Lite
伪静态工具,ISAPI_Rewrite3_Lite 3.0
熊数据集集2983张VOC+YOLO格式.zip
数据集格式:VOC格式+YOLO格式 压缩包内含:3个文件夹,分别存储图片、xml、txt文件 JPEGImages文件夹中jpg图片总计:2983 Annotations文件夹中xml文件总计:2983 labels文件夹中txt文件总计:2983 标签种类数:1 标签名称:["bear"] 每个标签的框数(注意yolo格式类别顺序不和这个对应,而以labels文件夹classes.txt为准): bear 框数 = 3021 总框数:3021 图片清晰度(分辨率:像素):清晰 图片是否增强:否 标签形状:矩形框,用于目标检测识别 重要说明:暂无 特别声明:本数据集不对训练的模型或者权重文件精度作任何保证,数据集只提供准确且合理标注
vue+springboot_基于Java语言的茶叶销售商城电商系统_176brjo7毕业设计源码数据库.zip
vue+springboot_基于Java语言的茶叶销售商城电商系统_176brjo7毕业设计源码数据库.zip
43一个强到且很实用的Linux网络管理工具.docx
43一个强到且很实用的Linux网络管理工具


