Media Street have been offering a diverse range of digital services to local and international businesses for over 10 years. With a credible client portfolio and a wide knowledge of all-things-digital, we have helped businesses grow through creative website and graphic design, successful marketing campaigns and competitive hosting packages, plus much more. Take a further look into our latest news articles, learn more about our staff and how we can help your business excel with our FAQ’s and testimonials.
I was asked today how to create a redirect on a website so visitors of that site who accessed it with the non www. address got redirected automatically to the www. version. The reason, in this particular case, was to improve the SEO of the website.
So, in this instance, we had the website accessible at:
And the issue with this set-up was that it was possible the content was being seen as a duplicate (because, technically – it’s two separate addresses) also, when users were sharing the content on social networks like Facebook and Google Plus the counters weren’t adding up correctly. This was because i.e 30 people had shared http://websiteaddress.co.uk whereas 200 people had shared http://www.websiteaddress.co.uk .
Setting up a non www. redirect
To solve this issue you can set-up a redirect in your .htaccess file. For our hosting customers you’d need to access your website via FTP and get the file from your “public_html” folder (the root folder). If you don’t have a .htaccess file there you can create one from scratch, just open a .txt editor and save it as .htaccess (without any file extension at the end).
Once you’ve found/created your file you just want this snippet of code there: