[英]replace underscore with dash using url rewrite module of iis
我有关于网址重写模块的问题。
我想对我的网站实施永久重定向(301)。 和网址是,我想永久重定向
http://demo.datadiary.com/search/product/ahmedabad/ac_dealers
网址至
http://demo.datadiary.com/search/product/ahmedabad/ac-dealers
提前致谢。
我找到了解决方案。 将以下内容放入您的web.config中,但请记住,主机必须在iis中安装了Url重写模块。
<rule name="Imported Rule 1-2" stopProcessing="true">
<match url="(search/product/ahmedabad.*/[^/]*?)_([^/_]*)$" ignoreCase="false" />
<action type="Redirect" url="{R:1}-{R:2}" redirectType="Permanent" />
</rule>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.