How to 301 redirect a complete website to another domain

Move one website to another?

Or possible have a development website that you wish to redirect to production?

With .htaccess, one can simply:

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