Example 9: Home Page Redirection 编辑

New Company, Inc. recently acquired a smaller competitor, Purchased Company, and wants to redirect the home page for Purchased Company to a new page on its own Web site, as shown here.

To redirect requests to the Purchased Company home page, you would create rewrite actions with the values in the following table.

Action NameType of Rewrite ActionExpression to choose target referenceString expression for replacement text
Action-Rewrite-Replace_URLrREPLACEHTTP.REQ.URL.PATH_AND_QUERY“/products/page.htm”
Action-Rewrite-Replace_HostREPLACEHTTP.REQ.HOSTNAME“www.newcompany.com”

You would then create rewrite policies with the values in the following table.

Policy NameAction NameUndefined ActionExpression
Policy-Rewrite-Replace-NoneAction-Rewrite-Replace-NoneNOREWRITE!HTTP.REQ.HOSTNAME.SERVER.EQ(“www.purchasedcompany.com”)
Policy-Rewrite-Replace-HostAction-Rewrite-Replace_HostNOREWRITEHTTP.REQ.HOSTNAME.SERVER.EQ(“www.purchasedcompany.com”)
Policy-Rewrite-Replace-URLAction-Rewrite-Replace_URLNOREWRITEHTTP.REQ.IS_VALID

Finally, you would bind the rewrite policies globally, assigning the first a priority of 100, the second a priority of 200, and the third a priority of 300. These policies should be the last policies applied to a request that matches the criteria. For this reason, set the goto expression to END for the first and third policies, and to 300 for the second policy. This ensures that all remaining requests are processed correctly.

Requests to the acquired company’s old Web site are now redirected to the correct page on the New Company home page.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:62 次

字数:2783

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文