Hi,
301 Redirection and Canonicaling are 2 different methods. But both can help you to avoid duplicating contents.
Hope you need to know how to do those, right?
301 redirection is using to direct one url to another url permanently. That means if you will redirect http;//www.yourdomain.com/images.php to http://www.yourdomain.com/images/ using 301 redirection, all the search engines will understand your page have permanently moved to a new location. So search engines will index your new page instead of the old page. And about 95% of link juice on old url will be redirected to new page.
301 redirection can be initiated by using .htaccess in linux servers and also in server side script in your page. If you have a plan to redirect using .htaccess file maybe this guide will help you.
If you are planing to redirect using the server side scripting this guide will help you.
Rel Canonical is a different way than redirection. It will not direct you to another location. As an example just imagine you have two pages with two different urls, first is http://www.yourdomain.com/page1.php and second page is http://www.yourdomain.com/page2.php but you have used same contents on both pages. So in this point you have a duplicate content issue. Now you have to select which page you need to be indexed by search engines. So, if you need to index the first page you the following Rel Canonical link between tags.
When using this canonical link users can visit both pages. It will not redirect. But search engines will understand the second page is just a duplicate page of first page.
Mostly this Rel Canonical link is so helpful to ignore the unwanted suffixes from url. Here is an example about that.
http://www.yourdomain.com/index.php
http://www.yourdomain.com/?refferer=some_refferer
http://www.yourdomain.com/index.php?sessid=a6yda7dafdd
Above url types (also more) can be indexed in search engines because of many reasons. But really those 3 urls will show you the contents of http://www.yourdomain.com/ So in this case there are 3 duplicate pages of http://www.yourdomain.com/ and search engines will also index those 3 duplicate pages and you will get duplicate content issue.
So, if you have used Rel Canonical tag to your home page as
then no problem there will generate how many kind of duplicates made of your home page. Search engines will ignore those and will not indexed and will not have any duplicate content issues.
Hope this will help you and ask for more help if there anything else you confusing.
Regards
Prasad