简体   繁体   English

通过我的域重定向远程域

[英]redirect remote domain through my domain

I have a site, lets say it's called www.supersite.com.我有一个网站,假设它叫做 www.supersite.com。 Now, I have a site called www.subsite.com.现在,我有一个名为 www.subsite.com 的网站。 I would like to make calls to subsite return what is on supersite but keeping the url to subsite.我想调用子站点返回超级站点上的内容,但将 url 保留到子站点。

Now, to make it more interesting, the only change needed on subsite is this: Change www.subsite.com A record to {the IP of supersite}现在,为了让它更有趣,唯一需要在子站点上进行的更改是:将 www.subsite.com A 记录更改为 {supersite 的 IP}

I have full control of supersite, so if it needs any configuration for something like this, it can be done.我完全控制了 supersite,所以如果它需要像这样的任何配置,它可以完成。

take care, lee保重,李

This should work:这应该工作:

Let the A record of www.subsite.web point to the same machine which runs www.supersite.web .www.subsite.webA记录指向运行www.supersite.web同一台机器。

Then in the Apache configuration file of the machine which runs www.supersite.web , alias subsite and supersite using Apache's ServerAlias directive:然后在运行www.supersite.web的机器的 Apache 配置文件中,使用 Apache 的ServerAlias指令别名子站点和超级站点:

<VirtualHost *:80>
  ServerName www.supersite.web
  ServerAlias www.subsite.web
</VirtualHost>

Read more about ServerAlias and VirtualHost .阅读有关ServerAliasVirtualHost的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM