子域重定向到另一台服务器 [英] Subdomain redirecting to another server

查看:19
本文介绍了子域重定向到另一台服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站托管在共享托管计划中.我的域名是在 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(在 Amazon AWS 上).我想让它表现得像一个普通域,而不是一个简单的 header('Location: ...') 或 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 记录映射到@".使用子域前缀作为主机添加一个新条目,例如:

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 访问主域.

The second line should allow you to access the subdomain using sub.mydomain.com, while the main domain will still be accessible using mydomain.com.

这篇关于子域重定向到另一台服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆