301 redirect using .htaccess
Create a .htaccess file with the below code.
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
Place the .htaccess file into your root directory. The above code will redirect all visitors to the site where the .htaccess exists to the new URL you enter into the .htaccess file.