Avoiding Ghost Sub-Domains and Duplicate Content

Avoiding Ghost Sub-Domains and Duplicate Content

By | September 19, 2012 at 8:20 pm | No comments | Technology

As you may know, duplicate content can seriously harm your websites rankings if your content is attributed to another domain or sub-domain.  There are multiple ways this can happen, but I recently encountered a scenario with one my own domains where a sub-domain I had not created was actually out-ranking the www. version of the website.  This introduced me to the concept of ghost sub-domains.

The subdomain in question was not a simple mistype of www but an English dictionary word – Orange – and the website affected was a mobile telecommunications website so I can see how this could have occurred, but once again I had not set up the subdomain so I was puzzled as to how the sub-domain existed.

.htaccess 301 Redirect

My first port of call was install a redirect via the .htaccess file.  This worked fine and redirected all subdomains to the sub-domain of my choice (www.):

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.

RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

A small note regarding WordPress users – the .htaccess is sometimes generated in a non-standard way and a plugin called WP Htaccess Control was required on some of my WordPress installs to override the one in the root folder.

However, this caused me to think of potential problems with ranking sub-domains that were carrying penalties that were since removed. So I decided against this option unless it was a completely clean domain.

Default Wildcard (*) DNS Configuration

However, I am currently hosted with Heart Internet and for all they offer amazing customer service, up-time etc, they have a flaw (at least from an SEO standpoint) in their internal configurations.

Their configuration for DNS settings automatically creates a wildcard DNS setting that will resolve any sub-domain that is created to your domain name allowing anyone to create a sub-domain version of your website.  Again, I’m known for looking at things in a “how can I exploit this” way (e.g. Google Analytics Bombing) so my first thought went to ways of how this could be exploited for nefarious deeds by ranking a sub-domain on a powerful website with a unexpected and none-work-safe sub-domain.  Childish I know, but that’s how I roll.

I’m unsure if this is prevalent with other hosts, but in order to stop any sub-domain resolving on your domain, remove the wild card DNS record and all should be fine.

I hope this helps remove any headaches for you.

About the Author

Kev Strong

Kev Strong is an online marketing consultant at Newcastle Upon Tyne based digital marketing agency, Mediaworks. A lover of all things search and an ex-web developer, Kev Strong (a.k.a Goosh) is a specialist in advanced search engine optimisation.