Smartest Method to Redirect non-WWW URLs to WWW?
In this post we will see the best method for redirecting non-WWW URLs to the WWW
1. Access your root account by using your email (or login) and password.
If you log in as a super admin, cPanel sends you to the admin dashboard first, but if you join in as a user, cPanel takes you directly to your account’s control panel.
2. From the admin dashboard Click List Accounts to go to your control panel.
3. Browse through your account listings until you find the account for which you want to log into the cPanel account.
4. To reveal a drop-down menu Click the Actions button, then choose Login to access the account’s control panel.
5. After that open the File Manager program, Click File manager in the FILES section of the control panel.
Look for your domain’s root directory in the file manager, and open it.
6. If for your main domain you’re putting up a redirect , the root directory should be the public_html.
7. Find a file named .htaccess within the root directory, right-click the file to reveal a menu, then select Edit to open the editor
8. Now, into the editor copy and paste your redirect rule and save.
And, add the below code to redirect from non-www URL to www URL:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) https://www.yoursite.com/$1 [R=301,L]
Save the .htaccess file.
After that, without the www type your URL in your browser to confirm it’s redirecting to the www version.
Kindly reach out to our support If you need help creating this redirect, and we’ll be available to help.