大家好,我需要一个URL重写规则(IIS或Apache),该规则会将每个请求从旧域重写到新域. 请注意,它还必须重写子域甚至查询字符串,例如下面的内容;
Hi guys, i need a url rewrite rule (IIS or Apache) that will rewrite each request from old domain to new domain. Please note that it has to rewrite also subdomains and even query string, example bellow;
products.olddomain > products.newdomain<br /> www.olddomain/default.aspx?test=1 > www.newdomain/default.aspx?test=1不仅如此,它甚至还必须保留协议,因此,如果有这样的请求; olddomain it should be newdomain 而且,我不想看到一个子域的示例,等等...我有数百个子域,它们是通用的,因此整个规则应该是动态的,并且能够接受所有类型的链接,并且在任何形式,都应简单地"从一个域切换到另一个域,并保持链接结构. 还有一件事,这应该是永久重定向 预先谢谢您.
and not only that, it even has to keep protocol, so if there was request like this; olddomain it should be newdomain and please, i don''t want to see examples for one subdomain, etc... i have hundrests of subdomains, which are generic, so this whole rule should be dynamic, and be able to accept all kind of links, and in any kind of form, and should "simply" switch from one domain to other, keeping link structure. one more thing, this should be a permanent redirect thank you in advance
推荐答案第一个网站包含10个重写URL的技巧. #8是保留协议.它还将帮助您保留查询字符串(我仅在IIS 6.0中完成过此操作)很抱歉询问以前的IIS版本,之后我看到标记被标记为IIS7. blogs.iis/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx [ ^ ] 这只是上面文章中出现的IIS 7重定向模块的直接链接. www.iis/download/URLRewrite [ ^ ] 这是一个有关如何使用IIS 7重定向模块的个人博客,我从未亲自使用过. mvolo/blogs/serverside/pages/Redirect-requests-to-您的应用程序-HttpRedirection-module.aspx [ ^ ] 希望对您有帮助,并祝您好运! The first website contains 10 tips for rewriting urls. #8 is to perserve the protocol. It also will help you with perserving the query strings(which I''ve only done in IIS 6.0) Sorry about asking which version of IIS earlier I saw the tag was marked IIS 7 afterwards. blogs.iis/ruslany/archive/2009/04/08/10-url-rewriting-tips-and-tricks.aspx[^] This is just the direct link to IIS 7 redirect module that appears in the above article. www.iis/download/URLRewrite[^] This is a persons blog on how to use the IIS 7 redirect module, which I have never personal used. mvolo/blogs/serverside/pages/Redirect-requests-to-your-application-with-the-HttpRedirection-module.aspx[^] I hope this helps and best of luck!
更多推荐
网址从旧域重写为新域
发布评论