use .htaccess for 301 redirect so that you pass the SEO juice also.
Say youwant to redirect mysite to yoursite then the following sample code of .htaccess should work
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
I hope I understand your query correctly.