一台虚拟主机多个域 | 通配符主机(共享主机)?
我有以下任务: 创建一个可通过 20 个不同域名访问的网站。
相同的文件,相同的文件夹,相同的IP。
问题(共享托管): 这可以通过一个裸cname指向同一个公共子域来完成吗?或者我们是否需要一个静态IP?
问题肯定是共享托管,我试图避免一一手动创建“cpanel 插件域”。 共享主机不允许修改 httpd conf,这允许我为 IP 创建通配符虚拟主机。
我想我的问题是自动回答的; 我需要一个静态的,除非我只使用子域的 w 通配符,它适用于共享主机。 “*.domain.com”、“two.domain.com”、“三.domain.com”=> 目录/
I have the following task:
Create one website which is accessible with 20 different domains names.
Same files, same folder, same ip.
Question (shared hosting):
Can this be accomplish with a bare cname's pointing to the same common subdomain or do we need one static ip for all?
The problem is sure shared hosting and I'm trying to avoid creating manually "cpanel addon domains" one by one. Shared hosting doesn't allow to modify httpd conf which allows me to create a wildcard virtual host for an IP.
I guess my question is auto answered; I'll need a static unless I'm only using subdomain's w wildcard, which works on shared hosting. "*.domain.com", "two.domain.com", "three.domain.com" => directory/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你已经回答了你自己的问题,你可以选择的选项是
I think you have answered your own question, the options open to you are
如果您使用 CNAME(或者实际上是指向同一 IP 地址的 A 记录),那么您必须如 Paul 所说,在
httpd.conf
ServerAlias 条目>,或者将它们指向默认
虚拟主机如果您无法做到这一点,请使用该主机的 19 号主机某些其他 Web 主机上的域名,然后使用 HTTP 重定向将用户带到“首选”域名。 但是,如果您执行此操作,则用户地址栏中的域名将会更改。
如果您
If you use a CNAME (or indeed an A record pointing to the same IP address) then you must, as Paul says, either have
ServerAlias
entries inhttpd.conf
, or point them at thedefault
virtual hostIf you can't do that, host 19 of the domain names at some other web host, and then use HTTP redirect to get users to the "preferred" domain name. However if you do this then the domain name will change in the user's address bar.