Why do some urls have www
You may have noticed that on many sites, the "www" part is not required. Another common thing you see is a name like ftp. A name server translates a name to an IP address.
If so, your name server connects to the name server for howstuffworks. If the HowStuffWorks name server has a listing for the www prefix, it returns the IP address for "www. The network administrator for the domain "howstuffworks. This gives the CDN the opportunity to supply an IP address that is close to the browser in geographic or network terms. If you used an A record on your site, then you would not be able to offer this flexibility.
However, your top level domain example. The use of www. The example. Note: As of the ratification and implementation by all current browsers, except possibly MSIE 11 , see comments of RFC in the following is no longer accurate, since cookies are by default never set across subdomains. Historically , one good technical reason to make www. A good solution is therefore to use a subdomain for static resources, such as static. All images and other static downloads can be downloaded from there.
If you now use www. If, however, example. An alternative is to use a whole different URL for static resources. Stack Overflow for example uses sstatic. Nowadays, the subdomain paradigm is unnecessary; if you connect to a website in a browser, you'll get the website, or sending mail to the server will use its mail service.
Using www or not is a matter of personal preference. Most servers send the same site either way, but don't redirect. For SEO purposes, choose one, then get the other to redirect to it. For example, some PHP code to do this:. However, some reasons promoting the use of a www subdomain made by other answerers are great too, such as not sending cookies to static servers credit Konrad Rudolph.
If you are going to have subdomains for other purposes blog for instance , you may want to differentiate the sites and have a www prefix for the regular site.
Other then that, the only important thing is to pick one of the two and stick to it for SEO reasons. It's pretty historical. Once upon a time we used to have www. These days I would just go for example. The Google Webmaster tools allow you to specify your preferred domain , so make sure you use those too. I'd do the first. The www convention comes from the early days of HTTP where www. By not having www, there is a minor downside when it comes to text-based media, whether printed or online, and that is getting it recognized as a web address.
But plain text online? Not so easy. So in order to make the URL into a clickable link, you have to either put www. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. In order to not use www, you will have to run your own server farms and you will be unable to use such services to their fullest extent.
Another reason has to do with cookies. One common web site optimization is to serve static content from a subdomain, such as static. If you use the naked domain, the cookies get sent to all subdomains by recent browsers that implement RFC , slowing down access to static content, and possibly causing caching to not work properly. The only way to get around this problem and keep the naked domain is to buy a second domain name just for your static content.
Twitter, for instance, which does not use www , had to buy new domain names just for static content. Of course, if you explicitly share your cookies across all your subdomains, for instance to implement single sign-on across various services on subdomains of your site Google does this , then you too would have to buy a new domain name in this circumstance anyway.
0コメント