IIS7 URL重写模块替换 [英] IIS7 URL Rewriting Module Replace

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

问题描述

我非常喜欢IIS7 URL重写模块,到目前为止,它对我很有用。

I really like the IIS7 URL rewriting module and so far, it worked great for me.

有一件事我不知道该怎么做:我想将所有编码空格(%20)的URL永久重定向到URL将空格替换为短划线( - )。

There is one thing that I'm not sure how to do: I would like to permanently redirect all URLs that have encoded spaces (%20) in them to a URL that has the spaces replaced with a dash (-).

所以这个:

http://www.test.com/About%20Our%20Mission.aspx

应重定向到:

http://www.test.com/About-Our-Mission.aspx

是吗甚至可能只用正则表达式?

Is that even possible with only regular expressions?

推荐答案

没有办法直接做你想要的。

There's no way to do directly what you want.

您可能会满足于此:

^(.*)%20(.*)%20(.*)%20(.*)  replaced by:  {R:1}-{R:2}-{R:3}-{R:4}
^(.*)%20(.*)%20(.*)         replaced by:  {R:1}-{R:2}-{R:3}
^(.*)%20(.*)                replaced by:  {R:1}-{R:2}

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

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