Non-www to www URLs Redirection – 3 Simple Ways 2020

Ask Me How To / WordPress Hacks

Non-www to www URLs Redirection – 3 Simple Ways 2020

Non-www links to www redirection in WordPressRedirecting non-www requests to the www version of your website’s URL is totally an individual choice. But, it helps you to avoid duplicate content on the Google index and it will also avoid the possibility of split page rank and or split inbound links.

Frankly speaking there is no SEO benefit or www over non-www.

In this article, we will learn how to redirect non-www to www URLs using these three methods. We have already discussed http to https redirection earlier.

Methods to redirect non-www URLs to www in WordPress

We will be following these three common methods to redirect our all WordPress Website URLs to WWW version.

  1. Using the WordPress General Settings
  2. Editing the .htaccess file
  3. Cloning a website using Softacuous App Installer

Redirect non-www to www using WordPress General Settings

This is really a very simple step which people don’t know. But being in digital marketing for quite a few years now I have used this method most frequently for our client websites.

Here are the steps that you need to follow –

  1. Open WP Admin Panel
  2. Navigate to Settings and then General Settings
  3. Change the WordPress Address (URL) field to the www version of your website
  4. Change Site Address (URL) to www version

Note – Here you have to change both i.e WordPress Address (URL) and Site Address (URL) both to www. You can refer to the image given below. Else if you change one and not change another your website will break and you have to fix this from PHPMyAdmin which is really a complicated task for a new blogger.

non www to www redirection using WordPress general Settings
non www to www redirection using WordPress general Settings

This is really a very simple method. Isn’t it? Comments your thoughts on this.

Now let’s navigate to the next method.

Non-www to www redirection in WordPress uisng .htaccess file

To redirect a non-www URL to www, we need to place a rule in the .htaccess file. You can do it via FTPSSH, or your control panel.

Follow the steps below to edit your .htaccess file from Hostinger’s hPanel:

1. Head over to the Files section and open File Manager in cPanel.

2. Navigate to the public_html directory, right-click on the .htaccess file, and select Edit. If the .htaccess file is not showing then you need to enable the hidden files. Refer to the image given below.

Showing hidden files in cPanel
Showing hidden files in cPanel

3. Insert the following lines under the RewriteEngine On:

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

4. Don’t forget to modify the code with your actual domain name instead of mydomain.com. Once you’re done, don’t forget to save the changes.

There you have it! By finishing this method, you have learned how to redirect non-www URLs to www. From now on, when someone accesses http://mydomain.com, they will be redirected to http://www.mydomain.com.

Please use this method properly as depending on you are using https or Http on your website as a current protocol it may need some changes in the above code.

I found it quite frustrating as many a time these codes break the site or you may get errors like “too many redirections, try clearing cookies

Now let’s see the last method to redirect non www URLs to www for a WordPress Website.

Non-www to www in WordPress using Softaculous Clone Features

Softacolous is a very important tool. Most of the good hosting companies like Resellerclub, Interserver, A2 Hosting provide this along with cPanel.

But, never buy Godaddy hosting as they are a thief. They will not give you a lot of important features that are required like SSL, Softaculous, High Memory and more.

Here comes the steps to execute non www to www using Softaculous.

1. Open cPanel i.e follow https;//www..domain_name.com/cpanel link

2. Navigate to Softaculous App Installer Section and open WordPress

Opening WordPress from Softaculous App Installer in cPanel
Opening WordPress from Softaculous App Installer in cPanel

3. Click on the clone button available in front of current WordPress installation.

cloning in softaculous
Cloning in Softaculous

4. Clone your current domain to any directory like https://okravi.com to https://www.okravi.com/new/

Cloning a website in Softaculous
Cloning a website in Softaculous

5. Delete the original installation ie. https://okravi.com

6. Again clone the directory installed WordPress to the main domain like https;//www.okravi.com.new/ to https;//www.okravi.com

7. Make sure your current site with www is working fine. If yes, delete the directory installation and enjoy. We are done here.

I know this is a very easy method but you should do it with caution. Otherwise, you will lose your data. If possible use the first method or take a backup before performing cloning again and again.

Conclusion – Non-www to www redirection

As per my experience, there is no such benefit of www over non-www on ranking. I have seen many top bloggers without www.

It is just a myth that www ranks better than non-www.

OK Ravi

The important is to always use https as it matters for ranking. Make sure to use https and you should also join our Advanced SEO Mastery and WordPress Mastery Course to understand it better.

So, You can use any of these two protocols for your WordPress Website.

  1. https;//okravi.com
  2. https://www.okravi.com

Thanks for reading. Have a good day.

Happy Blogging!

Comments (5)

  1. Asim Khan Ji

    I am really a big fan of your blogs, Your blog is really awesome and I would like to say thank you to share such good information. I have started doing your tactics on my website to rank on google. Let’s see how it goes.

    Please keep sharing good articles.

    Thanks

    1. User Avatar

      Thank your Asim. Appreciated!

  2. loyalnewsbihar

    Hi Okeyravi, your in-depth knowledge of Digital marketing not only help us to sell through the internet but also help in establishing ourselves in this digital Universe. Guys, It is one of the best platforms to excel your Digital Marketing knowledge rest assured you are in a great company.

    1. User Avatar

      Thanks, Loyal News. We loved your response.

    2. Osman

      really Thank u

Comments are closed.