Redirect all www addresses to non-www web addresses How can I redirect all traffic from www.domain.com/page to domain.com/page?

I need to disallow traffic to web addresses that include the www. The reason is that I have an SSL certificate that only works with non-www web addresses. If users try to access https://www.domain.com, they get a certificate error.
Uncomment lines 93 and 94 in the .htaccess file that comes with Drupal in the web root.

RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewiteRule ^ http://%1%{REQUEST_URI} [L,R=301]


EDIT: If the certificate requires https, edit the second line to read:

RewiteRule ^ https://%1%{REQUEST_URI} [L,R=301]