為什么有些網站需要“www”?

[英]Why do some websites require “www”?


Why do some websites require the "www" before the rest of the address, while others seem to resolve just as well with the "www" as without it?

為什么有些網站在地址的其余部分之前需要“www”,而其他網站似乎也解決了“www”和沒有它的問題?

Is there some compelling reason why you would set up your domain name to work like this?

是否有一些令人信服的理由說明為什么要設置域名才能像這樣工作?

2 个解决方案

#1


There are several reasons, here are some:

有幾個原因,這里有一些:

1) The person wanted it this way on purpose

1)這個人故意這樣做

People use DNS for many things, not only the web. They may need the main dns name for some other service that is more important to them.

人們使用DNS來做很多事情,而不僅僅是網絡。對於對他們來說更重要的其他服務,他們可能需要主dns名稱。

2) Misconfigured dns servers

2)配置錯誤的DNS服務器

If someone does a lookup of www to your dns server, your DNS server would need to resolve it.

如果有人向您的DNS服務器查找www,您的DNS服務器將需要解析它。

3) Misconfigured web servers

3)配置錯誤的Web服務器

A web server can host many different web sites. It distinguishes which site you want via the Host header. You need to specify which host names you want to be used for your website.

Web服務器可以托管許多不同的Web站點。它通過Host標頭區分您想要的站點。您需要指定要用於網站的主機名。

4) Website optimization

4)網站優化

It is better to not handle both, but to forward one with a moved permanently http status code. That way the 2 addresses won't compete for inbound link ranks.

最好不要同時處理兩者,而是使用移動的永久http狀態代碼轉發它。這樣,2個地址將不會競爭入站鏈接排名。

5) Cookies

To avoid problems with cookies not being sent back by the browser. This can also be solved with the moved permanently http status code.

避免瀏覽器不發送cookie的問題。這也可以通過移動的永久http狀態代碼來解決。

6) Client side browser caching

6)客戶端瀏覽器緩存

Web browsers may not cache an image if you make a request to www and another without. This can also be solved with the moved permanently http status code.

如果您向www和其他人請求,Web瀏覽器可能不會緩存圖像。這也可以通過移動的永久http狀態代碼來解決。

#2


Some sites require it because the service is configured on that particular set up to deliver web content via the www sub-domain only.

某些站點需要它,因為該服務是在該特定設置上配置的,僅通過www子域提供Web內容。

This is correct as www is the conventional sub-domain for "World Wide Web" traffic. Just as port 80 is the standard port. Obviously there are other standard services and ports as well (http tcp/ip on port 80 is nothing special!)

這是正確的,因為www是“萬維網”流量的傳統子域。就像80端口是標准端口一樣。顯然還有其他標准服務和端口(端口80上的http tcp / ip沒什么特別的!)

Imagine mycompany...

mx1.mycompany.com 25 smtp, etc

mx1.mycompany.com 25 smtp等

ftp.mycompany.com 21 ftp

ftp.mycompany.com 21 ftp

www.mycompany.com 80 http

www.mycompany.com 80 http

Sites that don't require it basically have forwarding in dns or redirection of some-kind.

不需要它的站點基本上具有dns轉發或某種類型的重定向。

e.g.

*.mycompany.com 80 http

* .mycompany.com 80 http

The onlty reason to do it as far as I can see is if you prefer it and you want to.

我能看到的最重要的理由就是你喜歡它而你想要它。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/03/08/725870b342fc3d2b9d69d041072054dd.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com