When I checked my site's backlinks with typing www and non-www in address box, both URL's are showing different backlinks. I searched on google to use 301 redirect method to get rid of this problem. but I am not getting this file and procedure to create 301 redirect. So please help me to create this file.
This issue is regarding the canonical...... if your site is on platform of PHP then put the 301 redirect code in .htaccess file: <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?>
using this code use redirect your site with www. RewriteEngine on RewriteCond %{HTTP_HOST} ^url$ RewriteRule ^(.*)$ "http\:\/\/www\.urll\.com\/$1" [R=301,L]
A bit off topic, I hope you don't mind: does doing a 301 redirect pass on PR to another website? I want to buy a PR5 site and redirect the authority to my new ecommerce website, the high PR site will not be relevant to my new site, is this a problem?
Download the .htaccess file from your website’s root web folder to a folder on your machine where you can edit it. Make a copy of the .htaccess file and save it somewhere else for safe keeping in case you need to revert to the old version – do not edit this version. Open the original .htaccess you downloaded in Notepad Add the following code (in red) into the .htaccess file. Be sure to substitute “example.com†with your own website information but touch nothing else. RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] Upload the file back to your website in the exact same place you downloaded it. Once the upload is complete open a browser and try visiting the “non-www†version of your website address. If the .htaccess is working as it should you will be redirected.
If you don't know how to do 301 redirect don't worry. Refer this URL http://support.google.com/webmasters/bin/answer.py?hl=en&answer=44231, you just need to Preferred domain. once you prefer you domain, its not necessary to do 301 redirection.