大网数据广告活动
网站运营与故障问答

Why won't my site load unless it's using www?

· 52CE 我爱测

My website will only load into the webpage if I use "www.". I'm using * on the dns source (stands for @ on hostway), so shouldn't it redirect all requests to the webpage? Idk, I'm a beginner, just need some help that's all.

问题原文

原帖链接 · DomPizzaMan · CC BY-SA 4.0

My website will only load into the webpage if I use "www.". I'm using * on the dns source (stands for @ on hostway), so shouldn't it redirect all requests to the webpage? Idk, I'm a beginner, just need some help that's all.

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

The wildcard record you set up matches all subdomains. It does NOT match the domain apex. Your website doesn't work for the no-www domain because you do not have a DNS record for it.

To get it to work, you must create an A record for the domain apex (@) pointing to an IP address given to you by your hosting company. To do that, leave the type field as A, put your domain name in the source field, (according to the instructions in your screenshot), and enter the IP address in destination field.

Note that you are not allowed to create CNAME entries for the no-www domain apex. It is not allowed according to the DNS specifications. If you try to do so, your website will not work reliably and no email to your domain name will be delivered correctly.

It is possible that your hosting company only supports pointing to them by a hostname. They may not give you an IP address to use for an A record. Such hosting companies typically tend to change your site's IP address frequently and without warning. So if you look up an IP address to use and put it in, your site may stop working before long.

If that is the case, some DNS providers allow ALIAS or ANAME records. You create them with the same host name as for a CNAME, but they are served as A records. The DNS host periodically (like every few minutes) looks up the IP address for that host, and serves the current value as an A record.

It does not appear that hostway supports ALIAS records according to https://support.hostway.com/hc/en-us/articles/115000343790-How-do-I-view-and-edit-my-DNS-Records So if you need an ALIAS record, you will have to switch to a different DNS host that supports them.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2020-03-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。