Prevent Duplicate Content

Having duplicated content within search engines is a very common problem that is often overlooked. You would think having duplicated content will be good for your search rankings, although that is not the case as it may be not useful to the end-user.

www-vs-non-www (Problem)

Search engines recognize your www.your-domain.com and your-domain.com as two separate websites. You may not be penalized by having multiple results although you can improve the efficiency for end-users combing through the search results. In addition, if you have a single convention of your domain usage people linking to your site can improve your link backs.

www-vs-non-www (Solution)

Since search engines track these as separate sites you need to pick either your www domain or the non-www domain. You still want both versions active although what you want to do is to create a 301 Permanent Redirect to your desired domain. For example, http://discoverforce5.com will redirect your browser to http://www.discoverforce5.com. By performing a 301 Permanent Redirect you are telling search engines not to store/index the redirected content for that page/location.

One thing to not forget is that you make sure you allow your website URL paths to be included during the 301 Permanent Redirect process. For example, http://discoverforce5.com/Media-Hub/ will send the end-user to http://www.discoverforce5.com/Media-Hub/. As you see it makes sure to send the end-user to their original desired page.

ASP.NET Code Example:

In this example we want to use the www domain as the main convention and redirect the non-www domain. The code below you see we grab the current domain and the URL path the request was made. We then check to see if the domain includes the www, if not, we perform the 301 Permanent Redirect.


// get server name/domain
string sDomain = Request.Url.Host.ToString().ToLower(); // i.e. discoverforce5.com
// get url path
string sPath = Request.RawUrl.ToString();
// check if www is in the server name
if (!sDomain.Contains("www."))
{
// server name does not contain www - proceed with 301 Permanent Redirect
Response.RedirectPermanent("http://www." + sDomain + sPath);
}

Apache Server Example:

With Apache servers this process is easier with utilizing the .htaccess functionality. Below you will see the Apache server equivalent to the ASP.NET example above.


RewriteEngine On
RewriteCond %{HTTP_HOST} ^discoverforce5.com$ [NC]RewriteRule ^(.*)$ http://www.discoverforce5.com/$1 [R=301]

Inconsistent Linking

Try to keep internal and external page links to your content consistent. For example, don’t link to http://www.discoverforce5.com/Services/ and http://www.discoverforce5.com/Services and http://www.discoverforce5.com/Services/Default.aspx as all three examples are different.

If you are interested in learning about how to submit your site to search engines feel free to read “The little things to not forget about during development [Part: 2]“.

Have any SEO needs or questions? Please give Force 5 a call.


Categories

Archives