子域名重定向到另一台服务器重定向、另一台、服务器、域名

2023-09-12 21:27:03 作者:Not stingy. 不吝啬。

我有托管在一个共享的托管计划网站。我的域名被注册为GoDaddy的,而域名服务器是我的那些共同主办(到目前为止,一切正常)。

I have a website hosted on a shared hosting plan. My domain name is registered at GoDaddy, and the nameservers are those of my shared hosting (so far, all normal).

但我试图找出如何添加子域名并将其指向别处。我想指出sub.mydomain.com其他一些IP(亚马逊AWS)。我想有它的行为像一个正常的域,而不是一个简单的标题(位置:...')。或者window.location.href

But I'm trying to figure out how to add a subdomain and point it somewhere else. I would like to point sub.mydomain.com to some other ip (on Amazon AWS). I would like to have it behave like a normal domain, and not a simple header('Location: ...') or window.location.href.

这甚至可能吗?如果是这样,那我怎么办?

Is this even possible? If so, how do I do?

感谢

推荐答案

是的,它是可能的。在GoDaddy的控制面板,编辑您的DNS区域文件,添加一个A记录的子域。你应该已经有一个A记录映射到@你的主要领域。使用子域preFIX作为主机添加新条目,如:

Yes it is possible. In the GoDaddy Control Panel, edit your DNS Zone File and add a "A record" for the subdomain. You should already have a A record for your main domain mapped to "@". Add a new entry using the subdomain prefix as host, e.g.:

Host    Points To

@       <main domain IP address>
sub     <subdomain IP address>

第二条线应该允许您访问使用 sub.mydomain.com 的子域,而使用 MYDOMAIN的主域名仍然可以访问。 COM