我有一个服务器。我们称之为 http://A.com
我还有一个“Enjin”论坛板。我们称之为 http://ABcom。
该服务器对于管理员的许多脚本和功能组件都很有用。论坛板是供社区使用的,但我只能向其中添加 HTML 模块。没有自定义脚本。
目前,我已将其设置为将 http://A.com 的索引重定向到 http://ABcom 使用 HTML 重定向,因此导航到 A.com 根目录的用户将被发送到论坛。
我想这样做,如果您导航到 http://A.com,它将显示 http://ABcom。我们曾经使用过 iFrame,但这对论坛产生了不利影响,所以目前我们只是重定向它们。我看到有人使用相同的系统,其 URL 例如 http://C.com/forums/viewforum /212877 显示 http://CBcom/forums/viewforum/212877
我认为 mod_rewrite 可以做到这一点,但具体如何呢?
I have a server. Lets call it http://A.com
I also have an 'Enjin' forum board. Lets call it http://A.B.com.
The server is useful for many scripts and functional components for the admins. The forum boards are for the community, but I can only add HTML modules to it. No custom scripting.
Currently, I have it set up to redirect the index of http://A.com to http://A.B.com using HTML redirection, and so those who navigate to the root of A.com will be sent to the forums.
I would like to make it so if you navigate to http://A.com, it'll show the contents of http://A.B.com. We once used an iFrame, but that had a detrimental affect on the forums, so currently we just redirect them. I've seen someone using the same system have a URL such as http://C.com/forums/viewforum/212877 showing the contents of http://C.B.com/forums/viewforum/212877
I assume mod_rewrite could be capable of this, but how exactly?
发布评论
评论(1)
听起来您想设置一个反向代理,其中客户端从 http://A.com/ 使用 HTTP 从 http://ABcom/ 检索页面,然后将该内容作为其自己的响应返回给客户端。
请参阅http://httpd.apache.org/docs/2.2/mod/ mod_proxy.html#proxyvia
"使用 ProxyPass 指令或 RewriteRule 指令。没有必要转动 ProxyRequests 以便配置反向代理。”
您需要检查页面上的链接会发生什么情况。如果 http://ABcom/ 使用绝对链接,那么它们将指向 http://ABcom/ 。但相对链接仍位于 http://A.com/ 下。
It sounds like you want to set up a reverse proxy wherein a client requests a page from http://A.com/ retrieves the page from http://A.B.com/ using HTTP, and then returns that content as it own response to the client.
See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyvia
"A reverse proxy is activated using the ProxyPass directive or the [P] flag to the RewriteRule directive. It is not necessary to turn ProxyRequests on in order to configure a reverse proxy."
You would need to check what happens regarding links on pages. If http://A.B.com/ uses absolute links then they will be to pages inside http://A.B.com/ . But relative links will still be under http://A.com/ .