Paste the following code below into your .htaccess file located in public_html/*

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^ [NC]
RewriteRule ^(.*)$$1 [R=301,L]
Which will redirect

Very useful for scripts which detect if you are logged in from a specific domain

*This will only work with servers that have .htaccess files enabled within their apache config - WHUK offer cPanel / Shared Linux packages which offer this service