it seems google has picked up my business advertising directory WITHOUT the www 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
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
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) redirect 301 / http://www.mysite.com/ Code (markup):
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
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...
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.
cheers fryman...that works... will http://mysite now completely disappear from google cache? and be replaced with the http://www.mysite version
Thanks fryman, he will indeed need your correction if both name forms are pointing into the same directory and thus the same .htaccess
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).