【问题标题】:replace underscore with dash using url rewrite module of iis使用 iis 的 url 重写模块将下划线替换为破折号
【发布时间】:2012-12-26 00:40:17
【问题描述】:

我有关于 Url 重写模块的问题。

我想在我的网站中实施永久重定向 (301)。和 url 是,我想永久重定向

http://demo.datadiary.com/search/product/ahmedabad/ac_dealers

网址

http://demo.datadiary.com/search/product/ahmedabad/ac-dealers

提前致谢。

【问题讨论】:

  • I have issue 有什么问题???看来你忘了问你遇到的问题!!!
  • 我已经问过我不能做 301 重定向。这就是问题所在。

标签: asp.net url web-config rewrite


【解决方案1】:

我得到了解决方案。将以下内容放入您的 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>

【讨论】:

  • 如果你有~/search_products/items_list.aspx目录和页面名称,你怎么办?
猜你喜欢
  • 1970-01-01
  • 2010-11-19
  • 2011-12-24
  • 2013-03-22
  • 2013-04-01
  • 1970-01-01
  • 2013-01-24
  • 1970-01-01
  • 2011-02-14
相关资源
最近更新 更多