Well it depends, via the http server, PHP or?

For example, PHP:

PHP Code: 
header'Location: http://www.differentsite.com/' ); 
Or there's of course via the server, such as lighttpd... BUT I think the solution you're looking for is usually offered via control panel on your server or where you registered the domain. For instance, you should be able to setup "URL Forwarding" via GoDaddy or NameCheap to the main URL.