I have example.com, which points to web server using A records, I want to redirect all traffic from www.example.com to example.com.As far as i know these are methods,301 HTML redirect from www to example.comAdd CNAME alias for www to @Add A record for www to webserver IPWhat is the best way to do it without affecting my search engine ranking?
What is the best way to redirect my naked domain?
seo;domains;301 redirect;best practices;no www
The 301 redirect is what you want to use if SEO is your primary concern. The 301 redirect will not only tell the search engines your pages have moved (assuming you are currently using both the www and non-www versions of your pages) but also help them associate the old URLs with the new URLs. This means any links you have to your old pages will count towards your new pages. They do lose a little bit of value because of the redirect but that's better not not doing it at all.See this answer for more info on 301 redirects and www/non-www 