使用社交网络应用程序充当域名经销商有多困难?
我正在考虑为利基爱好者网络创建一个社交网络,我知道人们希望拥有自己独特的域名 (www.myfoowebsite.com),而不是我选择的平台上的任何他们独特的 url ( www.opensourcesocial/124/ghyu.php)
我想最好的比较是 http://flavors.me/ 它允许你要连接你自己的域名..
我该如何处理这个问题?我知道人们需要将他们的名称服务器指向我的应用程序,但我对我需要做什么感到茫然。
任何指导表示赞赏。
I'm thinking of creating a social network for a niche hobbyist network and I know there's an appetite for people to have their own unique domain name (www.myfoowebsite.com) as opposed to whatever their unique url is on my platform of choice (www.opensourcesocial/124/ghyu.php)
I guess the best comparision is http://flavours.me/ which allows you to hook up your own domain..
How do I approach this? i know people will need to point their nameservers towards my app but I'm rather at a loss as to what I would need to do my end..
Any guidance appreciated..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您想要注册域名(所谓的
顶级域名
- .at、.de、.com、.org ...?)?您需要:
SOA、MX、A、AAAA(如果您的服务器支持 IPv6)、NS ...
- 对您来说重要的是最后的A 或/和
包含您的服务器 IPv6 地址的内容(例如 - 如果可能)AAAA
记录,需要包含您服务器的 IP 作为内容:例如,您需要
www.yourdomain.com
的A 记录
,其中包含服务器 IPv4 地址的内容(例如)127.0.0.1
和 < code>AAAA 记录::1
这是非常基本的解释 - 您需要一些专业知识(或有一些专业知识的人!)才能正确且安全地做到这一点!
You want to register domains (so called
top level domains
- .at, .de, .com, .org ...?)?You need:
SOA, MX, A, AAAA (if your server is IPv6 capable), NS ...
- important for you are at the end theA
or/andAAAA
records which need to contain the IP of your server as content:for example you need an
A record
forwww.yourdomain.com
with content of your servers IPv4 address (e.g.)127.0.0.1
and anAAAA record
with content of your servers IPv6 address (e.g. - if possible)::1
That's explained very basically - you need some knowhow (or someone who has some!) to do that appropriately and securely!
最后,您可以将您的站点设置为 ip 的任何域名的默认值(通常在 Apache 中,如果您使用它,则使用
ServerAlias *
指令(请参阅 文档)。然后,您所要做的就是阅读
$_SERVER[ 'HTTP_HOST']
PHP 中的变量,并采取相应的行动。On your end, you'd set your site as default for any domainname for the ip (usually in Apache, if you use that, with an
ServerAlias *
directive (see the documentation).Then, all you have to do is to read the
$_SERVER['HTTP_HOST']
variable in PHP, and act accordingly.您很可能需要一个专用服务器来执行此操作(在这种情况下,请参阅@Wrikken 的答案),或者一个同意向您的托管包的服务器注册外部域的良好托管提供商。不是每个人都这样做。
完成后,PHP
$_SERVER["HTTP_HOST"]
变量将为您提供请求页面的域名。You will most likely need a dedicated server to do this (in this case see @Wrikken's answer on how), or a nice hosting provider who agrees to register external domains with your hosting package's server. Not everyone does that.
Once that has been done, the PHP
$_SERVER["HTTP_HOST"]
variable will give you the domain name the page was requested under.