【问题标题】:Redirect URL without showing new URL?重定向 URL 而不显示新 URL?
【发布时间】:2012-11-18 13:40:03
【问题描述】:

是否可以在不显示新 URL 的情况下将 URL 重定向到另一个 URL?

例如:

当用户访问 www.sample1.com/page1.html 时,它应该显示 www.sample2.com/page2.html 。但 URL 需要显示为属于 www.sample1.com 或类似 www.subdomain.sample1.com/blah.html 的内容。

我需要为另一个域托管一些页面,但这些页面看起来应该属于该域或该域的子域。

在我的情况下,使用 iframe 不是一种选择,欢迎任何其他建议。

【问题讨论】:

    标签: url redirect mod-proxy


    【解决方案1】:

    最简单的可能是使用mod_proxy 在子上下文中显示所有sample2.com 页面:

    ProxyPass   /sample2   http://www.sample2.com
    

    因此,sample2.com/page2.html 将显示为 sample1.com/sample2/page2.html

    否则mod_rewrite 也可能有用,特别是proxy|P flag

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-05
      • 2016-09-08
      • 2013-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-08
      • 2015-05-01
      相关资源
      最近更新 更多