使用IIS的URL重写模块替换破折号下划线 [英] replace underscore with dash using url rewrite module of iis

查看:484
本文介绍了使用IIS的URL重写模块替换破折号下划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题关于URL重写模块。

I have issue regarding Url rewrite module.

我要实现永久重定向(301)到我的网站。 url是,我要永久重定向

I want to implement permanent redirect (301) into my site. and url is, I want to permanently redirect

http://demo.datadiary.com/search/product/ahmedab​​ad/ac_dealers

网址

http://demo.datadiary.com/search/product/ahmedab​​ad/ AC-经销商

先谢谢了。

推荐答案

我得到了解决。把下列你的web.config,但请记住,你的主机必须在IIS中已经安装了URL重写模块。

I got the solution. put the following into your web.config, but keep in mind that your host must have installed Url rewrite module in iis.

<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>

这篇关于使用IIS的URL重写模块替换破折号下划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆