NYCPHP Meetup

NYPHP.org

[nycphp-talk] Maybe [ot] Duplicate Content.

Andrew Yochum andrew at plexpod.com
Tue Feb 1 15:05:46 EST 2005


On Tue, Feb 01, 2005 at 02:33:16PM -0500, inforequest wrote:
> Hans C. Kaspersetz hans-at-cyberxdesigns.com |nyphp dev/internal group 
> use| wrote:
> 
> >I am working on migrating a site from one server to another today.  On 
> >the old server there were multiple domains pointing at one virtual 
> >site eg:  www.domain.com, domain.com, www.domain.org and domain.org 
> >all point to the same virtual site and therefore the same content.  
> >(Duplicate content.)  I am trying to devise a migration strategy that 
> >will include 301 redirects and DNS.
> >Do the search engines handle A records and CNAME records differently?  
> >If www is a CNAME to domain.org, is that the same as two A records 
> >www.domain.org and domain.org as far as search engines are concerned?  
> >Is that subject to the duplicate content penalty?  Do I need to create 
> >2 distinct virtual sites one for www and one for domain.org and have 
> >one of them redirect to the other?
> >
> >Hans
> 
> 
> I'd like to see what others have to say on this as well.
> 
> An A record assigns an IP to the domain, so that's not the issue 
> w/respect to search engines. Your issue is in the virtual hosting or C 
> name/alias configuration.
> 
> Your means of implementing a C name (alias) will determine if it is 
> "appropriate" or not. For example I have seen cpanel implementations 
> (older) deploying 302 redirects, and I have seen cpanel (newer) 
> implementing c names as a transparent alias (Apache simply generates 
> 200OK plus the site content), which appears to the search engines as a 
> completely separate site (hence duplicate content). With a modern cpanel 
> set the c name alias and then put a 301 in place at that location for 
> each additional domain to feed the primary domain. I guess that is the 
> same as you called "Do I need to create 2 distinct virtual sites one for 
> www and one for domain.org and have one of them redirect to the other? 
> ". That is what I do.
> 
> It is always best to test and examine headers. Avoid 302's and if yu 
> have multiple domains serving the same content make sure all but one are 
> robots.txt for noindex (as a mirror).
> 
> -=john andrews

I do something similar.  I have all domains point an A record at the
same IP, which normally would cause duplicate content.  To solve that I
have an include that goes in the my prepend of every site that looks
something like:

    $Config['Hostname'] = 'www.somedomain.com'

    if ($_SERVER['HTTP_HOST'] != $Config['Hostname']) {
        Header("HTTP/1.1 301 Moved Permanently");
        Header("Location: http://" . $Config['Hostname'] . $_SERVER['PHP_SELF'] . (StrLen($_SERVER['QUERY_STRING'])? "?".$_SERVER['QUERY_STRING'] : ''));
        exit();
    }

... which ensures that the hostname being used to access the requested
page is the one we want to be called by...  "I'm not Drew, I'm Andrew!"
I call this "hostname assertion".

Regards,
Andrew



More information about the talk mailing list