We will discuss the best technique for redirecting non-WWW URLs to the WWW in this post.
1. Use your email (or login) and password to access your root account.
If you log in as a super admin, cPanel sends you to the admin dashboard first, but if you join in as a user, Spanel takes you directly to your account’s control panel.
2. Click List Accounts from the admin dashboard to go to your control panel.
3. Please browse through your account listings until you find the account for which you want to log into the cPanel account.
4. Click the Actions button to reveal a drop-down menu, then choose Login to access the account’s control panel.
5. Open the File Manager program, Click File manager in the FILES section of the control panel.
In the file manager, look for your domain’s root directory and open it.
6. If you’re putting up a redirect for your main domain, the root directory should be the public_html.
7. Locate a file named .htaccess in the root directory, right-click the file to reveal a menu, then choose Edit to open the editor
8. Now, copy and paste your redirect rule into the editor and save.
And, to redirect from a non-www URL to a www URL, add the below code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) https://www.yoursite.com/$1 [R=301,L]
Save the .htaccess file.
After that, type your URL without the www in your browser to confirm it’s redirecting to the www version.
If you need assistance creating this redirect, kindly reach out to our support for quick help, and we’ll be available to help.
Also Check: How to Set Up Redirects in cPanel
If you need a more powerful web hosting solution to cope with increasing demand, visit our homepage.