HomeSEO TIPSHow to Redirect Non-www...

How to Redirect Non-www to www URLs

Redirecting non-www requests to the www version of your website’s universal resource locator is useful for SEO functions. Not solely can it assist you to avoid duplicate content on the Google index, however, it’ll additionally avoid the chance of split page rank and or split incoming links. during this article, we’ll learn the way to send non-www to www URLs mistreatment the .htaccess move into your public_html folder.

Editing .htaccess File

Step 1:

  • If you are using cPanel, login into your account, and choose the File Manager.
cPanel login file managar

Step 2:

  • Navigate to the public_html directory, right-click on the .htaccess file and select Edit.
edit .htaccess file  in cPanel

Note- Sometimes, dotfiles (files their names start with a dot) because the .htaccess file is hidden from the manager. to form them visible, click the Settings button within the top right corner and check the Show Hidden Files (dotfiles) option from the Preferences tab.

Step 3:

  • Insert the following lines under the Rewrite Engine On:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Where is your actual domain name.

Redirect Non-www to www URLs

Step 4:

  • Don’t forget to switch the code together with your actual name rather than Once you’re done don’t forget to save lots of the changes.

Congratulations, you’ve got successfully enabled a .htaccess file that will redirect all visitors from a non-www URL to the www version of your website! Wasn’t hard in the least, was it?


There you’ve got it! By finishing this tutorial, you’ve got learned the way to redirect non-www URLs to www. From now on, when someone accesses

From now on, when someone accesses The visitor will be redirected to

Hopefully, this tutorial was helpful. allow us to know within the comments below if you face any issues.

Vimal K. Vishwakarma
Vimal K. Vishwakarma
Hello friends, I am Vimal K. Vishwakarma, Technical Author & Co-Founder of Techno Vimal. Talking about education, I am an Engineering Graduate. I enjoy learning things related to new technology and teaching others. I request you to keep supporting us like this, and we will keep providing further information for you. :)



Please enter your comment!
Please enter your name here

Most Popular