1. Home
  2. Knowledge Base
  3. cPanel
  4. Settings
  5. How to force redirect domainname.com to www.domainname.com via cPanel?

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

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.

Click here to view this article as Oryon knowledge base video tutorial playlist.

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support