Redirect from old domain to new domain using htaccess

Just simple redirect from old domain to new domain permanently in simple way using htaccess like


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.old-domain-name\.com$ [OR]
RewriteCond %{HTTP_HOST} ^old-domain-namey\.com$
RewriteRule ^(.*)$ http\:\/\/new-domain-name\.com\/$1 [R=301,L]