Forum Moderators: buckworks & webwork

Message Too Old, No Replies

Omitting 'www.' on a domain

         

markd

7:57 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dear all

I was asked today how it is possible to omit the 'www.' when typing in a URL and still get to a web site.

eg. 'domain.co.uk', as opposed to 'www.domain.co.uk'

I was embarrased to say that I couldn't give definitive answers.

I know that this is possible if a server can use subdomains, I also think the flavour of server is an issue.

Can somebody give me a more comprehensive 'list' of how it is possible to do this - is it down purely to server/domain configuration?

Many thanks

ChadSEO

9:00 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



Essentially it comes down to the web server being configured to respond to both www.domain.tld and domain.tld. This can be accomplished in a number of different ways:

  • The domain has it's own ip address, and all requests to this ip respond with the same site. Then it is a simple matter of setting both domain.tld and www.domain.tld to resolve to the same ip address.
  • On Apache, for a VirtualHost, it is possible to set a ServerAlias, so that the site is served for all requests to the ServerName and any ServerAlias's.
  • I'm sure there's a way to do it with IIS, but I couldn't figure it out in 30 seconds and gave up.

    Hopefully that will suffice to answer your question.

  • markd

    9:07 pm on Jul 25, 2005 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Thanks Chad

    Would either of the methods you describe have an adverse effect on search engine positions - particularly if the www.site.co.uk was achieving good rankings before anything was changed on the server?

    Would this also require a dedicated server - the site I was asked about is on standard, shared hosting with an ISP/host

    ChadSEO

    9:32 pm on Jul 25, 2005 (gmt 0)

    10+ Year Member



    Most (decent) hosting companies will setup both the www and non-www versions by default. Search engines will see these as seperate sites, so it is best to choose only one to use, and do a 301 redirect from the other. For instance, if you go with the www version (since that already has good rankings), then any requests to the non-www version will receive a 301 redirect to the www version. This can definitely be done on a shared hosting plan. If you're on an Apache server, a quick .htaccess file can do this. If not, perhaps someone else can help you.

    If you are on Apache, here's what you would want to put in your .htaccess file:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.tld
    RewriteRule ^(.*)$ [domain.tld...] [R=301,L]

    markd

    7:40 am on Jul 26, 2005 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Thanks Chad - really helpful.

    Sounds as though being on a Windows server may complicate things.

    In your opinion, is there any great benefit to doing this - other than users not having to type in 'www' before the domain?

    bill

    8:29 am on Jul 26, 2005 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    markd the important point here is that you choose one format and then consistently apply your server settings site wide.

    Several years back I made the decision to set my server to force everyone to the shorter http://example.com version of my site. My thinking at the time was that it's 4 characters less and www. is unnecessary. I standardized this on all printed materials and online linking. There are valid arguments for keeping the www. as well. You just have to pick the one you want, and stick with it. ;)

    On a Windows server you can re-write the URLs as well. Someone posted this helpful link in another thread: URL Rewriting in ASP.NET [msdn.microsoft.com]

    gpmgroup

    9:07 pm on Jul 26, 2005 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Explains how to do sub-domains on IIS in detail.
    [webmasterworld.com...]
    The Question there was for "www.sub.domain.com" works exactly the same for "domain.com"

    dataguy

    9:19 pm on Jul 26, 2005 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    I started several sites years ago without the 'www.' and they rank very well. (I do 301's for the 'www.' versions though the DNS provider.)

    What I have had trouble with is that most of the domain ranking services check backlinks and listings by using the 'www.' versions, which makes my sites look very unpopular. For example, in Google if you look for one of my sites with 'site:www.sitename.com' it shows 155 listings. If you look for 'site:sitename.com' it shows 125,000 listings.

    It's not a real problem as far as day to day business is concerned, it's just a minor annoyance. If I ever wanted to sell these sites though, I could see it effecting the perceived value of the sites.

    bradley phil

    4:01 pm on Jul 27, 2005 (gmt 0)

    10+ Year Member



    how could i go about redirecting www.example.co.uk to www.example.net - my hosting is configured to www.example.net, and I have used cPanel to 'Park' the .co.uk

    Webdetective

    12:37 am on Aug 6, 2005 (gmt 0)

    10+ Year Member



    It's possible, the www issue could have been responsible for the recent banning of a couple of my sites by Yahoo and Google. I did notice upon checking backlinks how www.domain vs domain would sometimes yield slightly different results. Unfortunately, I was completely unaware of this until long after it was too late and yesterday when somebody pointed it out to me. I added the .htaccess code to my site to correct the problem.

    Good question is if I feel this may have been a possible reason for the banning, how should I contact Yahoo and Google for inclusion? BTW Yahoo does not appear to have any contact page or email.