php 地址为“www”的网站不工作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13389088/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Website with address ' www' is not working
提问by Linto
I have a site , for example test.com.
我有一个网站,例如 test.com。
While i take the site as 'test.com' in the browser i getting the site.
当我在浏览器中将该站点作为“test.com”时,我得到了该站点。
But while i try with 'www.test.com'.Its showing server not found issue.
但是当我尝试使用“www.test.com”时。它显示服务器未找到问题。
It doesn't have any htaccess file ,also there is nothing in the index.php page that make this issue .
它没有任何 htaccess 文件,index.php 页面中也没有任何内容导致此问题。
Any one have any idea
任何人都有任何想法
回答by Strannik
1) check your dns
1)检查你的DNS
2) you may be need added record DNS www IN CNAME domain.com.
2) 您可能需要在 CNAME domain.com 中添加记录 DNS www。
3) send mail to support hosting.
3)发送邮件以支持托管。
Enjoy=)
享受=)
回答by Drew Schatt
There are several potential causes, but they boil down to two main categories: dns or server configuration.
DNS can be tested with either ping, dig, nslookup, or any number of other tools, depending on what OS you are using. Basically, if you check the ip address for both example.com and www.example.com, they should both have the SAME ip address (group of four numbers separated by periods).
IF THEY DO, your dns is fine in this case (there are other cases where you would want them to do different things, but for right now, just make sure that they have the same ip address).
Next, you need to tell your web server configuration, to tell it that both example.com and www.example.com should use the same files and content. With Apache, this can be done using the ServerName and ServerAlias directives.
Hopefully, this should help.
有几个潜在的原因,但它们归结为两个主要类别:dns 或服务器配置。
DNS 可以使用 ping、dig、nslookup 或任意数量的其他工具进行测试,具体取决于您使用的操作系统。基本上,如果您检查 example.com 和 www.example.com 的 ip 地址,它们都应该具有相同的 ip 地址(由句点分隔的四个数字的组)。
如果他们这样做,在这种情况下你的 dns 很好(在其他情况下你会希望他们做不同的事情,但现在,只要确保他们有相同的 IP 地址)。
接下来,您需要告诉您的 Web 服务器配置,告诉它 example.com 和 www.example.com 应该使用相同的文件和内容。对于 Apache,这可以使用 ServerName 和 ServerAlias 指令来完成。
希望这应该会有所帮助。
回答by tonino.j
You need to edit your DNS settings & records with your domain provider.
您需要与您的域提供商一起编辑您的 DNS 设置和记录。

