Technical/Programming/Non-SEO Pros and Cons of WWW or no-WWW?

余生颓废 提交于 2019-12-10 16:18:19

问题


What are technical/programming/non-SEO pros and cons of www or no-www, for domains as well as sub-domains?

From Jeff Atwood's twitter at http://twitter.com/codinghorror/status/1637428313 :
"sort of regretting the no-www choice because it causes full cookie submission to ALL subdomains. :("
What does this mean? Is there a blog post or article detailing this?

What other specific issues and their reasons should be considered for www. vs no-www.

Update:
On searching for more info on this topic, I found following helpful ( in addition to Laurence Gonsalves answer ) :

  • Dropping the WWW Prefix
  • Impact on search results: Jivlain's and Isaac Lin's comments
  • Use Cookie-free Domains for Components
  • on StackOverflow : Should I default my website to www.foo or not?
  • on StackOverflow : When should one use a ‘www’ subdomain?

回答1:


Cookies are, by default, restricted to the host of the URL they were set on. So cookies set on "http://example.com/foo.html" can be seen by other pages on "example.com" but not pages on other hosts -- not even subdomains.

It is possible to set a domain attribute for a cookie which can make it visible to more hosts. This domain attribute must start with a dot and must be a suffix of the hostname of the page setting the cookie. Cookies set with a domain attribute are (potentially) visible to pages on hosts for which the domain attribute is a suffix. So if a cookie's domain attribute is ".example.com" it'll be visible on "www.example.com", "forums.example.com", "foo.bar.example.com" but not "example.com". So if you serve part of your site from "example.com" you can't make cookies that are visible to subdomains, but if you always use subdomains then you can make cookies that all subdomains can see.

You can find a very detailed but somewhat hard to read explanation of this in RFC2965. I also found a websiteGear article which has a pretty clear explanation.



来源:https://stackoverflow.com/questions/839095/technical-programming-non-seo-pros-and-cons-of-www-or-no-www

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!