How to force redirect domainname.com to www.domainname.com via cPanel? Print

  • 0

Step 1: Login to the cPanel account.

Step 2: Navigate to the section Files > File Manager menu.

Step 3: Select the .htaccess file and  right click on it.

Step 4: Select 'Edit' option in the list.

Step 5: Enter the below rule to force non-www to www to your domain.

 

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

 

Step 6: Click 'Save changes' to complete the setup.


Was this answer helpful?

« Back