www. not cached

Discussion in 'Site & Server Administration' started by Solicitors Mortgages, Aug 13, 2005.

  1. #1
    it seems google has picked up my business advertising directory WITHOUT the www :confused:
    have i got to do a 302 to kill this off and get it to only cache the www. version?
    otherwise it seems pointless building links for it if its cached wrong :(
     
    Solicitors Mortgages, Aug 13, 2005 IP
  2. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #2
    www.domain and domain are both indexed, but neither seem to be cached yet, you might as well do a 301 from domain to www.domain to help google out
     
    fryman, Aug 13, 2005 IP
  3. Solicitors Mortgages

    Solicitors Mortgages Well-Known Member

    Messages:
    2,217
    Likes Received:
    139
    Best Answers:
    0
    Trophy Points:
    103
    #3
    is it as simple as putting this in a htaccess file?
    can't seem to find any other information,
    (i am so crap with google searches) :eek:



    redirect 301 / http://www.mysite.com/
    Code (markup):
     
    Solicitors Mortgages, Aug 13, 2005 IP
  4. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That should work, but only for the front page; if you've got mod_rewrite enabled, it's more useful to do:

    RewriteEngine on
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
    
    Code (markup):
    Not tested, but should be correct (writing from memory). What it does is redirect any page request from mysite.com to www.mysite.com; for instance, if someone requests the page http://mysite.com/directory/another/file.html, it will redirect (with a 301 status code) to http://www.mysite.com/directory/another/file.html.

    I usually setup my sites the opposite way, with a 301 from www.mysite.com to mysite.com :D
     
    Willy, Aug 13, 2005 IP
  5. Solicitors Mortgages

    Solicitors Mortgages Well-Known Member

    Messages:
    2,217
    Likes Received:
    139
    Best Answers:
    0
    Trophy Points:
    103
    #5
    why would you do that?
     
    Solicitors Mortgages, Aug 13, 2005 IP
  6. Solicitors Mortgages

    Solicitors Mortgages Well-Known Member

    Messages:
    2,217
    Likes Received:
    139
    Best Answers:
    0
    Trophy Points:
    103
    #6
    just tried what you said mate...its not working.......it just hangs.... :(
     
    Solicitors Mortgages, Aug 13, 2005 IP
  7. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #7
    .............................
     
    fryman, Aug 13, 2005 IP
  8. Solicitors Mortgages

    Solicitors Mortgages Well-Known Member

    Messages:
    2,217
    Likes Received:
    139
    Best Answers:
    0
    Trophy Points:
    103
    #8
    and i just tried this one as well, just hangs.....

    weird.... if i have it pointing to www.digitalpoint.com it works in a flash.....but if i put my site name in...it just hangs...
     
    Solicitors Mortgages, Aug 13, 2005 IP
  9. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Personal preference, mostly. The 'www.' is a superfluous thing anyway, so for a couple of years now I've setup all my sites to use the actual domain name as their "canonical name", that is, the "real" name they are known by, and to do 301 redirects if anyone tries to use the longer "www." format (which makes the whole thing transparent for visitors).

    I suppose I could list lots of good reasons for the preference but in all honesty, it's ultimately a matter of aesthetics (as in, I still might do it even if there was some disadvantage to it; not that there is, AFAIK).

    On the web, opinion is divided as to which name form to use as the canonical name for websites. Luckily, it really is just a matter of opinion, as there's no "right" way to do it: both are equally valid as long you take care to do the 301 redirect from the non-canonical name (either www.site.com -> site.com or the opposite).

    In techie ("early adopter") circles, dropping the "www." seems to have been steadily gaining ground since the turn of the century (we're hopeless perfectionists, I suppose) and personally I expect that over the really long-term (say, a decade) this usage (dropping the prefix) will eventually become the dominant form.
     
    Willy, Aug 13, 2005 IP
  10. Solicitors Mortgages

    Solicitors Mortgages Well-Known Member

    Messages:
    2,217
    Likes Received:
    139
    Best Answers:
    0
    Trophy Points:
    103
    #10
    Solicitors Mortgages, Aug 13, 2005 IP
  11. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Thanks fryman, he will indeed need your correction if both name forms are pointing into the same directory and thus the same .htaccess :)
     
    Willy, Aug 13, 2005 IP
  12. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #12
    Yup, just give it some time and it should go and google will just focus on the www version
     
    fryman, Aug 13, 2005 IP
  13. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #13
    That's the theory. It will likely take some time, though. Take a look at this to see how it will show up when googling for the site name; the example site has implemented the redirection in the opposite manner, though (so in Google, www.site.com is showing up as site.com in the result list).
     
    Willy, Aug 13, 2005 IP