How to redirect an entire server or directory to a single URL: mod_rewrite

If all you need to do is migrate a server from one name to another, simply use the Redirect directive, as supplied by mod_alias:

Redirect /

Since, the redirect will forward along the complete path, it may not be appropriate - for example, when the directory structure has changed after the move, you simply want to direct people to the home page.

The best option is to use the standard Apache module mod_rewrite. If that module is compiled in, the following lines

RewriteEngine On
RewriteRule /.*

It will send an HTTP 302 Redirect back to the client, no matter what they gave in the original URL, they'll be sent to "".