Mod rewrite 删除最后一个字符“;破折号;从url
我试图删除最后一个“破折号”从我的网站网址的使用IIS重写模式 例如: /serie/fiche/50444/the-Foster-2013- 重定向301到 /serie/fiche/50444/the-fosters-2013(不带最后一个破折号) 我已经尝试过一些规则,但没有一个有效:Mod rewrite 删除最后一个字符“;破折号;从url,mod-rewrite,iis,rewrite,url-rewrite-module,Mod Rewrite,Iis,Rewrite,Url Rewrite Module,我试图删除最后一个“破折号”从我的网站网址的使用IIS重写模式 例如: /serie/fiche/50444/the-Foster-2013- 重定向301到 /serie/fiche/50444/the-fosters-2013(不带最后一个破折号) 我已经尝试过一些规则,但没有一个有效: <rule name="dash problem" stopProcessing="true"> <match url=".*" /> <conditions&
<rule name="dash problem" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^addictlive.com([A-Za-z0-9-_/]*)([-])$" />
</conditions>
<action type="Redirect" url="http://addictlive.com/{R:0}" />
</rule>
及
什么都不管用
请大家知道怎么做吗?我终于找到了一个解决方案:
<rule name="dash problem" stopProcessing="true">
<match url="(.*)-$" />
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>
<rule name="dash problem" stopProcessing="true">
<match url="(.*)-$" />
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>