Duplicate web content often exists without people knowing about it.
Most people see https://www.domain.com and https://domain.com as the same page, but search engines don’t—they see them as duplicate content.
Google sees duplicate content as “appreciably similar” content in more than one URL.
The major problem with duplicate content is that it’s difficult for search engines to decide on the version to include in the search index and rank for query results.
This confusion could impact search engine rankings negatively.
But you could fix this by redirecting all non-www URLs to their www version, and thankfully, here’s how.
Redirecting Non-WWW URLs to WWW
You can create web redirects by adding some lines of code to your domain .htaccess file—a server configuration file that lets users make quick changes to their server settings. Use this code to redirect from non-www to www.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Please replace domain.com on the code with your domain name and save the changes.
Always add your redirect rules below the RewriteEngine On line, unless you have it already at the top of the .htaccess file.
If you do, then use the code without the RewriteEngine On line to create the URL redirect.
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Now follow these steps to add the rule to your .htaccess file.
Step 1: Log into SPanel’s User Interface.
The default login URL is https://yourdomain.com/spanel/ (don’t forget to replace yourdomain.com with your actual domain).
Step 2: Open the File Manager
Locate the FILES section on the homepage and click File manager.
Navigate to your domain’s root directory in the file manager and open it.
If you’re setting up the redirect for your root domain, then the root directory should be the folder named public_html.
If it’s for a subdomain or addon domain, choose the folder bearing its domain name.
Step 3: Add Your Code
Locate a file named .htaccess in the root directory, right-click the file to reveal a menu, then choose Edit to open the editor.
Now, copy and paste your redirect rule into the editor and save. Then, type your URL without the www in your browser to confirm it’s redirecting to the www version.
Need Support?
If you need assistance creating this redirect, kindly reach out to our support for quick help, and we’ll be available to help.