How to redirect all URLs to a new domain I'm shutting down an old site and want to redirect all URLs to the homepage of a new domain. Is there a module or quick php snippet that can do just that?
The problem with trying to do it with PHP or a module is that PHP doesn't handle every request; for example, if someone deep linked to a file, no PHP solution would help.

So the easiest (and most complete) way to do this is actually with Apache (or whatever web server you happen to be using):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^old\.example\.com$
RewriteRule ^(.*)$ http://new.example.com/ [R=301,L]


You can do this in the host configuration file or the .htaccess file: assuming the old site is a Drupal site, you'll want to place everything except the first line immediately after RewriteEngine On (around line 58 in Drupal 7.x).