Not for a simple domain redirect, no. Sorry, I should have given you the exact code to use. I got myself muddled as to what you actually wanted. I would try this :-
Code:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.domain.org".$_SERVER['REQUEST_URI']);
?>
Replacing domain.org with the destination domain. This will work for all ordinary GET requests, but would require further work if you wanted it to deal with POST requests as well.