How to use mod rewrite forward to a new domain?

For examples, when we visit www.google.com, we want it redirect to http://kingphp.com, we can use the following code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

The code posted above should be used on the old server.

King Php Science Welcome, you are from: 23.20.157.174