Sputnik Web
Home > Blog > How to add automatically www to your URL

How to add automatically www to your URL

Current thought has advanced away from using multiple domain names for a website, but you may still fall foul of this problem unknowingly.

Google does not like multiple domain names pointing at the same website; it regards it as duplicated content and, although there is no discernable penalty for doing this, your page will only be indexed once, thus diluting the overall SEO effect of your website as some bits of your site will be indexed under one domain, and other bits under another domain.

If both http://mywebsite.com and http://www.mywebsite.com lead the visitor to your website you may find that this is effectively creating duplicated content (as Google will regard this as a domain and a sub domain called "www"). The answer is to lead all requests to your website to http://www.mywebsite.com so every visitor, including searchbots, are reading from the same metaphoric song book.

If you are running a Apache server the solution is simple. Add the following chunk of code to your .htaccess file or, if your site doesn't use an .htaccess file, create one containing the following code and upload it to the website root directory:

RewriteEngine on
Options FollowSymlinks
rewritecond %{http_host} ^mywebsite.com [nc]
rewriterule ^(.*)$ http://www.mywebsite.com/$1 [r=301,nc]

Now, if someone simply types "mywebsite.com" into their browser they should be seamlessly forwarded on to www.mywebsite.com, and what goes for the user also goes for seachbots.

Subscription

What Next?

Get In Contact

contact@sputnikweb.co.uk
01484 680 104

vcardDownload our vCard

Writing a website brief?

PDFRead 21 Questions
you need to ask youself...

Then give us a call!