Apache ReverseProxy域A子目录到域B根目录

时间:2019-09-11 05:46:35

标签: apache mod-proxy proxypass

示例网站为www.domainA.com。 我想将DomainA子目录之一重定向到DomainB根目录。例如,http://www.DomainA.com/Folder将重定向到http://www.domainB.com/以提供内容。

我在执行以下操作时尝试了Apache ProxyPass:

ProxyPass /folder/ http://domainB.com
ProxyPassReverse /folder/ http://domainB.com

但是这似乎不起作用,因为我只找到了一个页面。

我也尝试过做

ProxyPass /Folder/ http://domainA.com
ProxyPassReverse /Folder/ http://domainA.com

只是看看我是否可以仅使用索引文件将/ Folder重定向回domainA的根目录,而这也不起作用

1 个答案:

答案 0 :(得分:0)

尝试将其添加到您的domainA.com VirtualHost:

Redirect 302 /folder/ http://domainB.com/

(区分大小写)