【问题标题】:Redirect rule in Apache Server for two different serversApache Server 中针对两个不同服务器的重定向规则
【发布时间】:2017-02-16 19:50:34
【问题描述】:

我有两个不同的服务器 - 服务器 A 和服务器 B。

服务器 A 有一个应用程序 abc.example.com

服务器 B 有一个应用程序 www.example.com

我需要将 abc.example.com 重定向到 www.example.com/abc

我已将 CNAME(规范名称)分配给 abc.example.com 作为 www.example.com,所以目前每当我点击 abc.example。 com 它会打开 www.example.com 的内容,虽然它还没有被重定向。

我需要在“服务器 B”的 Apache 服务器中定义什么重定向规则,以便将来自“服务器 A”的 abc.example.com 的请求重定向到 www.example。 com/abc 包括路径 '/abc'

谢谢。

【问题讨论】:

    标签: apache redirect dns aem


    【解决方案1】:

    应该这样做-

    <VirtualHost *:80>
    
        ServerName abc.example.com
    
        RewriteRule ^/(.*)$ https://www.example.com/abc
    
    </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 2017-08-21
      • 1970-01-01
      • 2012-08-17
      • 2016-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多