It’s always interesting to stumble upon new websites and still see both the two variants of www. and non-www still accessible.

You might have noticed that some websites use the prefix of www. and some don’t. While this isn’t a do-or-die issue, it is best practice to ensure that only one variant is accessible.

Not only will your website look much neater, search engines will also be able to index and display your page’s URLs more consistently. It’s a win-win in all cases.

SEO Benefits: WWW or non-WWW

To be perfectly clear, there are no SEO benefits of choosing over the other. Google have also stated that it’s a personal preference thing.

Personally, I like the www. and think it works great in occupying more room on the search engine result pages.

You might have also noticed that the Red Search website uses www. Choose what you like, and we’ll move onto implementing the fix.

The Quick Fix

One simple way of fixing this issue is to implement a 301 redirect to the address of your choice. You can do this by adding a short line of code into your .htaccess file.

A website’s .htaccess file is typically located in the root folder of the website’s hosting server.

To find this file, you’ll need access to your FTP client. Once you’ve gained access, navigate your way through to /public_html/. Locate and open the .htaccess file. You’ll want to put in your 301 redirect code once the .htacccess file is opened.

WWW .htaccess Code

Okay, let’s say you want to keep the www. Copy and paste the code into the top of your .htaccess file.

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{http_host} !^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Non-WWW .htaccess Code

However, if you feel your domain may look cleaner without the www, simply whack in the following code:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{http_host} !^ [NC]
RewriteRule (.*)$1 [R=301,L]

After applying this code, you’ll want to wait a minute or two before testing the URL. Depending on which code you’ve used, your URLs should now be redirected as intended.

If you run into any problems, feel free to drop a comment below.

Daniel Law
Latest posts by Daniel Law (see all)

Why Us?

We believe that search engine optimisation (SEO) is one of the most powerful online marketing strategies available to your business. Let us help you grow your business online by using innovative SEO strategies proven to generate your business results. Find out more about our SEO services.

Find out how we can boost your business revenue through SEO.

The search landscape is ever-changing. Google regularly releases algorithmic search updates and new search result features that impact your business’ bottom line.

Stay at the forefront of search and speak to one of our specialists about how we can help grow your brand today.

  • Contact Form
  • Contact Form
  • Contact Form

Request My Complimentary Audit

*Your privacy is important to us. Your details will remain confidential at all times.

Keep up with the latest

Enter your email and keep up to date with latest industry changes