我一直在尝试找到一个简单的解决方案来创建特定网址的重定向列表。
我想定义 IIS 可以拦截的旧 url 列表,并 301 重定向到关联的新 url。
旧的 url 是本地的,新的 url 位于不同的域中。
新的 url 不具有相同的 url 格式,它们将是全新且不同的,所以我不想要一个使用某种智能正则表达式来自动执行此操作的 url 重写器。
我希望有一些东西,我可以只传递一个列表或 xml 文件,它就可以处理其余的事情。
IIS 或 asp.net 是否内置了这样的功能?
I've been trying to find a simple solution for creating a list of redirects for specific urls.
I want to define a list of old urls that IIS can intercept and 301 redirect to the associated new url.
the old urls are local, the new urls are on a different domain.
the new urls do NOT have the same url format, they will be completely new and different, so I don't want a url rewriter that uses some kind of smart regex to automate this.
I was hoping for something where I can just pass in a list or xml file and it can take care of the rest.
Is such a feature built in to IIS or asp.net?
发布评论
评论(2)
经过更多搜索后,我发现了 UrlRewriter.net: http://urlrewriter.net/index.php/支持/配置,
但是它说首选操作系统是 Windows Server 2003...这只是过时的信息还是我可以在我的 IIS 7 站点中安全地使用它?
有人有这个模块的经验吗?
after a little more searching I discovered UrlRewriter.net: http://urlrewriter.net/index.php/support/configuration
however it says the preferred OS is Windows Server 2003... is this just outdated info or can I safely use this in my IIS 7 site?
anyone have any experience with this module?
好吧,我想出了如何使用 IIS 7 的 Url 重写模块。它确实可以做到这一点,但不完全按照我想要的方式。
不过,模块中支持直接映射 url,所以经过一番一番努力之后,我让它开始工作了。
此页面对于弄清楚一些基本映射非常有帮助:http://blogs.iis.net/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx
okay I figured out how to use the Url Rewrite Module for IIS 7. it does indeed do this, but not exactly in the way I wanted.
however there is support for mapping urls directly in the module, so after a bit of fenagling I got it to work.
This page was pretty helpful in figuring out some basic mappings: http://blogs.iis.net/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx