ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

lauch new site with "www" prefix or without?

June 27, 2008 2:05pm

Subscribe [0]
  • #1 / Jun 27, 2008 2:05pm

    Joe Wolin

    206 posts

    I’m getting ready to launch a new website and debating the issue of including a “www” prefix to the url.  From what I understand I should choose one way or the other for the entire site.

    Is there an advantage to choosing one over the other?  It seems to me that removing the prefix allow for a shorter url which is obviously a bonus.

    What approach have you folks taken?

    thanks…

  • #2 / Jun 27, 2008 2:08pm

    Ingmar

    29245 posts

    I found that users tend to expect both versions to work, so that’s what I accomodate. I use Google’s webmaster tools to let them know that the site is one and the same, and that works very well.

  • #3 / Jun 27, 2008 3:16pm

    Joe Michaud

    154 posts

    I agree with Ingmar, my sites work both ways.

  • #4 / Jun 27, 2008 3:19pm

    Joe Wolin

    206 posts

    Yes, it works both ways, but one redirects to the other.  The question is about choosing the primary destination.  I’m leaning toward including the “www” as it seems more popular.  Thanks for the discussion.

  • #5 / Jun 27, 2008 3:51pm

    Joe Michaud

    154 posts

    Though I haven’t explored the implications, I use my DNS configuration to direct traffic appropriately.
    - The A record points example.com to the ip address

    Then EITHER
    - Another A record points http://www.example.com to the same ip address
    OR
    - A CNAME record points http://www.example.com to example.com

    For those of you watching this thread who are a little more knowledgeable, I’d be interested in knowing more about the advantages & disadvantages of using DNS vs redirects.

  • #6 / Jun 27, 2008 3:57pm

    bramb79

    47 posts

    I totally agree: use both versions. Advertise with the “www.” domain, because that is what most users expect.

  • #7 / Jun 27, 2008 4:18pm

    Adrienne L. Travis

    213 posts

    There’s also the consideration of subdomain cookies. A better explanation is here at Yahoo’s site optimization tips page, but the basic rundown is:

    - The web server can serve stuff faster if it doesn’t have to deal with cookies, since cookies are extra network traffic.
    - If you use domain.com as your main destination, the way most cookie setups work the cookies will work on domain.com, xyz.domain.com, and images.domain.com (assuming those are all on the same server).
    - However, if you use http://www.domain.com as your main destination, you can set cookies to only apply to http://www.domain.com, leaving all other subdomains untouched.
    - This is a good thing if you want to serve static components like images using a different subdomain name.

    If you don’t have the ability to repoint your root domain (even those of us who can manipulate our DNS through our webhost often can’t change THAT setting), or don’t wish to for whatever reason, you can easily handle the non-www case with mod_rewrite in your .htaccess file as follows:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^domain\.com [NC]
    RewriteRule ^(.*)$ <a href="http://www.domain.com/$1">http://www.domain.com/$1</a> [L,R=301]
  • #8 / Jun 27, 2008 8:06pm

    soxhead

    69 posts

    IMO it depends on the nature of the site. Web 2.0 sites in particular seem fond of dropping the www, but there are good arguments on both sides.

    Personally I always use the www., and redirect users to that. I like the way it looks, what can I say.

  • #9 / Jun 28, 2008 12:00am

    Shawn Blower

    39 posts

    I’ve always rather disliked the “www” prefix for web servers. It has become so common that everyone is accustomed to both seeing and saying it, and so it’s sort of invisible now, but it really is a goofy convention.

    John Gruber, Daring Fireball

  • #10 / Jun 28, 2008 6:30am

    shmooth

    9 posts

    For those of you watching this thread who are a little more knowledgeable, I’d be interested in knowing more about the advantages & disadvantages of using DNS vs redirects.

    i actually don’t know how the DNS stuff works, but i suspect it could be a bit faster that the redirects.

    The redirects actually require a second request/response round trip from your browser to the web server.

    You can simulate this via cmd line with a HTTP request to craigslist:

    /——-
    telnet craigslist.org 80

    GET / HTTP/1.0
    Host: craigslist.org

    ——-/

    The response you get:

    /——-
    HTTP/1.1 302 Found
    Content-Type: text/html; charset=iso-8859-1
    Connection: close
    Location: http://www.craigslist.org/
    Date: Sat, 28 Jun 2008 09:17:59 GMT
    Server: Apache/1.3.37 (Unix) mod_gzip/1.3.26.1a mod_perl/1.29

    <!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
    <HTML><HEAD>
    <TITLE>302 Found</TITLE>
    </HEAD><BODY>
    <H1>Found</H1>
    The document has moved <A >here</A>.
    <HR>
    <A>Apache/1.3.37 Server at sfbay.craigslist.org Port 80</ADDRESS>
    </BODY></HTML>
    ——-/

    When your browser sees that ‘Location’ header, it doesn’t even both to render the HTML page data below—it just immediately makes a brand new request for whatever URL is there - in this case, it’s using the ‘www’ version. So, it happens very quickly and invisibly to the user, but I suppose it could be meaningful if you want uber-fast performance.

    I suspect a DNS-based solution would not require this 2nd round trip request. Instead, the web server would just recognize what content you were asking for and serve the appropriate content. Of course, in the previous case, the URL in the browser changes to the ‘www’ version, whereas this DNS solution would not (assuming my guess is correct about how it works).

  • #11 / Jun 28, 2008 1:35pm

    Joe Michaud

    154 posts

    Thanks for the awesome explanation, shmooth!

    I don’t think one extra HTTP request is all that big of a deal…  Though I am a bit of a stickler for minimizing them.  I do little things like { embed } all of my supporting style sheets into my main one so that they are all served with a single request…  Ditto with JavaScript files.  But yea, not a big hit in terms of performance.

    With the DNS method I have 2 different urls (example.com & http://www.example.com) that serve up the same site.  Can anyone comment on the SEO implications?

  • #12 / Jun 28, 2008 1:53pm

    John Fuller

    779 posts

    Take a look at this post from Matt Cutts.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases