Create a new file named 404.php and enter the following code:
<?php
header("Status: 301 Moved Permanently");
header("Location:http://www.xxxxxx.tld");
?>
Replace www.xxxxxx.tld with your domain name and upload the 404.php file to your current WordPress themes folder located in: /wp-content/themes/