How to redirect non-www URLs to www?

You need help with the technicalities of your website?

You can redirect all of the requests for yourdomain.com domain to www.yourdomain.com by modifying your website’s .htaccess file. You need to add the following lines at the beginning of the file in order to setup that redirection:

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

Where yourdomain.com is your actual domain name.

You can edit the .htaccess file using the File Manager in cPanel or via FTP.

From now on, when someone access https://yourdomain.com the visitor will be redirected to https://www.yourdomain.com.

Sign up for our hosting and let us support you along the way!

Check out our hosting package!