# www and non www can suffer duplicated content

Do you know if i should use canonical tag, or 301 redirection from

http://mydomain.com to http://www.mydomain.com

To avoid duplicated content penalty in case other pages link to the domain without the www.? or is Google enough smart now just to identify whats the canonical one?

-