一台虚拟主机多个域 | 通配符主机(共享主机)?

发布于 2024-07-14 20:54:12 字数 364 浏览 3 评论 0原文

我有以下任务: 创建一个可通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情仇皆在手 2024-07-21 20:54:12

我想你已经回答了你自己的问题,你可以选择的选项是

  • 通过任何可用的方式将 ServerAlias 条目添加到虚拟主机配置中
  • 确保目标 IP 上的默认虚拟主机是处理你的站点的主机

I think you have answered your own question, the options open to you are

  • Add ServerAlias entries to the vhost config, via whatever means available to you
  • Ensure the default virtual host on the target IP is the one which handles your site
踏雪无痕 2024-07-21 20:54:12
  1. 如果您使用 CNAME(或者实际上是指向同一 IP 地址的 A 记录),那么您必须如 Paul 所说,在 httpd.confServerAlias 条目>,或者将它们指向默认虚拟主机

  2. 如果您无法做到这一点,请使用该主机的 19 号主机某些其他 Web 主机上的域名,然后使用 HTTP 重定向将用户带到“首选”域名。 但是,如果您执行此操作,则用户地址栏中的域名将会更改。

    如果您

  1. 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 in httpd.conf, or point them at the default virtual host

  2. If 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文