WWW.example.com or HTTP://example.com – which one is futureproof?

7,219

Solution 1

I personally prefer the www domains. As one of @Jonathon's points, the real main reason is with cookies. When you have example.com and you apply a cookie to it, that cookie governs all sub domains such as www.example.com, foo.example.com and bar.example.com which can cause you headaches in the future if you're dealing with sessions or security.

You can always have a example.com redirect to a www.example.com on the server side so when it comes to print media or linking with other sites, the less there is the better. A user will not bother to remember the www of www.example.com so its useless information and I would go as far as to say that the attempt to do so will make the user unhappy, thereby making them avoid your site altogether.

If you're interested/are using the framework, I can supply the code for such a redirect in the form of an ActionFilterAttribute for ASP.NET MVC (I spent 2 days perfecting the filter on my own, so I'm feeling pretty confident about it).

On another note, when it comes to the actual code on your site, don't skip out on details. Meaning, don't try to take http://www.example.com/Something/Something-Else into example.com/Something/Something-Else.

  1. It's not going to work because the browsers don't understand protocol-less links.
  2. Even if they did, the second Uri will cause a redirect to the www version if you're normalizing, resulting in a pointless round trip back to the server.

Solution 2

Personally I would put example.com on contact cards,etc and have it redirect to www.example.com. This can be done with a simple rewrite.

The reason for this is that my users should never be concerned with having to type www. I absolutely hate sites that require people to type the www - I think it's a completely outdated requirement from years gone by.

You would, however, want to 301 redirect from example.com or www.example.com. In fact, to anything. The point is to pick your favourite and set all the different ways to get to your site to redirect to the same place so that you aren't penalised for dupe content (I can't remember the SEO term).

The protocol is useless, since browsers will put it in for you (in fact, Chrome doesn't even show it).

Another reason that I have everything redirect to www.example.com is due to cookies. For example, the cookies on www.example.com will be completely separate from static.example.com but any cookie set on example.com will be sent with the HTTP request to sub1.example.com, sub2.example.com, etc. Although this is just my preference.

Solution 3

I don't know if the http:// is really required as mentioned above. Most browsers will assume http:// when a URL is type into the address bar if it is not present when the enter button is pressed. I'd say it only really is necessary in hyperlinks as then it is necessary for the link to function properly (unless the browsers assume http:// but at last check they didn't).

In print with or without the www is a tomato / tomáto situation. Users are familiar with the www and older web surfers will remember the days when it was required and is now habit. But it's also very common to see domains advertised without it so i don't leaving it off will confuse enough people to be concerned about it.

My advice is to choose one, any one, and stick with it. Consistency is key (and good usability).

Solution 4

Forget anything that says http:// -- too scary for non-geeks, and browsers handle this well enough these days (Chrome doesn't even show it on latest builds).

yoursite.example is, strictly speaking, the correct way to represent the domain, as the www. is deprecated.

However, the average man (or woman) in the street is more familiar with seeing www.yoursite.example, so if your audience is non-geeks, do them a favour, give them what they're expecting, and use www.yoursite.example.

If you want to be more cutting edge, your audience is geeky, or you want to school people, use yoursite.example.

Share:
7,219

Related videos on Youtube

Såm
Author by

Såm

Hello, I an architect from The Netherlands. I love drawing, cooking, fire and playing around discovering new stuff. My knowledge of programming is limited to the interaction that we as humans undergo in this rapidly digitalising world. I recently found out that programming techniques are also helpful in realworld architecture/urbanism. Like designing a public park that interact with human! The unique outcomes of such crazy projects is what triggers me! Contact me if you have a crazy project and need a refreshing concept! +31(zero) six four four seven seven seven seven zero zero ;) Sammy

Updated on September 17, 2022

Comments

  • Såm
    Såm over 1 year
    1. http://example.com
    2. www.example.com
    3. http://www.example.com
    4. example.com

    Which of these would you choose as your favourite to work with from 2016 onward? Which domain name would you mention to your clients, websites that link to you, your letterheads, your contact cards etcetera. Why one or the other? Which to avoid these days?

    Thinking of the following aspects:

    • validity, correctly loading URL
    • audience, most geeks know http://, most seniors don't
    • easiest to remember URL as a brand
    • misspellings by user input (in mobile phone or desktop browser)
    • browsers not understanding protocol-less links
    • total length of chars for easy user input
    • method of preference by major search engines/social media sites
    • consistency so that links don't fragment but all point to the same
  • MrWhite
    MrWhite over 13 years
    AFAIK only IE6 would assume http:// in hyperlinks if omitted!
  • DisgruntledGoat
    DisgruntledGoat over 13 years
    You can use a different domain for static content if you wish - Stack Overflow uses sstatic.net. If you have multiple TLDs you could use the alternate one - example.net if your main site is example.com.
  • DisgruntledGoat
    DisgruntledGoat over 13 years
    I don't know about the conditions of IE6, but any link without http:// should be considered a local link. The URL http://example.com/www.example.com is perfectly valid.
  • Jonathon
    Jonathon over 13 years
    Yeah - I was just giving a bit of an example as a consideration. Another example, if you're webhost.com and you host your customers as customer.webhost.com then you don't want your cookies passing to them. The static content example was just for static content awesomeness :)
  • Kristian Damian
    Kristian Damian over 13 years
    +1 I agree the www is a MUST for non-geeks guy, if you do ecommerce or sell something remember that most of you customers won't be geeks.
  • Såm
    Såm over 13 years
    thanks! VALIDITY is an important aspect on the web, i just added this essencial word into the question at the very top!
  • DisgruntledGoat
    DisgruntledGoat over 13 years
    I would disagree and say that if it's a common suffix - either .com or your country's local TLD (.co.uk in the UK) then you don't need http:// or www. However for other less common TLDs I would recommend the www over http.
  • Såm
    Såm over 13 years
    @Marco, thanks for new insight, i think i agree, now I know why i was struggling to choose between the www.yoursite and the always vaid yoursite ive updated this issue in the question
  • Såm
    Såm over 13 years
    Thanks Alex, updated your info into considerations of main question!
  • Gup3rSuR4c
    Gup3rSuR4c over 13 years
    I just want to add about the protocol-less links, its in terms of linking to other sites/resources. If you're doing your own local links you can get away with relative links, ie. /Something. If you're linking to other sites/resources then it can become problematic... (it was 2 AM when I was answering, so I wasn't all there, lol)
  • UpTheCreek
    UpTheCreek over 13 years
    what do you mean when you say 'the www. is deprecated' - is this from w3c?
  • robob
    robob over 13 years
    @UpTheCreek - actually, this may not strictly be true, as i can't find anything definitive at w3.org. Perhaps it is more correct to say that it was never necessary?
  • Kristian Damian
    Kristian Damian over 11 years
    @Fosco: print would be definitely better www.yoursite.com less chars and immediately recognizable by all type of folks as a website.
  • Kristian Damian
    Kristian Damian over 11 years
    @Jonathon: IMHO putting domain.com on contact paper card is a mistake. Average people (no tech geeks) might not understand that it's a website. I noticed it with emails, even if we send emails from [email protected], people still ask: "What's your site/domain?". BTW: excellent point about webhost.com and customer.webhost.com
  • Fiasco Labs
    Fiasco Labs about 11 years
    @MarcoDemaio - I've seen that in actual real-world terms. People have come to expect certain things because it's easier to memorize exactly what it should look like than know technical details.
  • Fiasco Labs
    Fiasco Labs about 11 years
    Internally deprecated by a web subgroup only if they're not using the web to the full. Cookies are a mess and now you start using a cdn and a blog. Subdomaining will be around for a long, long time. Mostly an SMSification by the above.
  • Sandeep Bhaskar
    Sandeep Bhaskar over 5 years
    Nowadays you should default to https:// links instead of http://
  • Sandeep Bhaskar
    Sandeep Bhaskar over 5 years
    Nowadays you should default to https:// links instead of http://