redirect old domain to new domain
To redirect old site to new, create .htaccess file with following content and upload to old web site.
Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://newurl.com/$1 [R=301,L]
New Web Site with Different URL Structure
In this case, we will redirect all web pages on old server to main page of new web site. We can redirect each url of old web site to new web site, but that will take time. Here is lazy solution
RewriteEngine on RewriteRule ^$ http://www.webhostingneeds.com/ [R=301,L] RewriteRule (.*) http://www.webhostingneeds.com/?ref=$1 [R=301,L]