We know that search engines have the ability to determine the www and non-www versions are the same and combine the results but occasionally it fails and we see both versions is indexed, and this is bad for the site owner since link benefit (PR/anchor text) is shared over two sites.
Here's a few step to resolve this problems by editing the .htaccess file and write a permanent 301 redirect script on it:
1. Go to your cPanel.
2. Then File Manager
3. Find your .htaccess file on public_html.
4. Check the checkbox on .htaccess file.
5. On toolbar click Edit.
6. Write this script on your .htaccess file (the red ones and change the "example.com" with your domain name):
For non www to www:
------------------
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
For www to non www:
------------------
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
7. After write the script then save it.
8. Now try visit your site.
Hope this helpful :naughty:
Cheers :biggrin:
Here's a few step to resolve this problems by editing the .htaccess file and write a permanent 301 redirect script on it:
1. Go to your cPanel.
2. Then File Manager
3. Find your .htaccess file on public_html.
4. Check the checkbox on .htaccess file.
5. On toolbar click Edit.
6. Write this script on your .htaccess file (the red ones and change the "example.com" with your domain name):
For non www to www:
------------------
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
For www to non www:
------------------
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
7. After write the script then save it.
8. Now try visit your site.
Hope this helpful :naughty:
Cheers :biggrin: