To redirect visitors requesting a specific host name to a whole new host name, use the following snippet in your .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?oldhost\.com$
RewriteRule ^(.*)$ http://www.newhost.com/$1 [R,L]
</IfModule>This will check for visitors requesting either oldhost.com or www.oldhost.com and redirect them to www.newhost.com.
Tired of typing your passwords all the time?
Check out this excellent guide on how to set up SSH keys on your web server to automate logins from your SSH client.