redirect non www to www

To work with total SEO on your site and work professionally also you have to take total care about your site. Do you know the difference between non www and www? Sometimes we need to use non www because of SEO. But if you want to use multiple subdomains on your domain, so you must need to use www version. Because without www, the subdomain will be risky or maybe not work.

Use www is now our tradition also. When you will visit a high authority site you must see with www. Because now your site is small but one day it could be big and then you would be used a subdomain on your site. For this in starting you have to use www version on your site.

How to redirect non www to www by .htaccess?

To redirect from non www to www, you have to edit .htaccess file on your Cpanel root folder.

It’s very easy to redirect non www to www. For this, you have to do the following instructions.

  • Click setting on Cpanel file manager
  • Show Hidden Files (dotfiles)
  • Edit .htaccess file
  • Copy the following codes and paste it on your .htaccess file.

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

  • Click on save changes

Your work is complete. Now just visit your site. You will see the www version on your site now.

Conclusion:

In this process, your visitor will be automatically redirected from non www to www version. If you are going to build a website from this you want to make money and want to provide service lifetime you must have to redirect non www to www must. It brings your high authority also.

This work will be something like this:

Previous version: https://yourdomain.com

New version: https://www.yourdomain.com

Note this also:

if you want to go from www to non www you need to use the following codes.

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

You are all set.

Previous version: https://yourdomain.com

New version: https://yourdomain.com

LEAVE A REPLY

Please enter your comment!
Please enter your name here