Structuring Site Directories
On my personal and non-critical sites, I frequently swap between CMS setups, forums, etc. That can become a serious problem if you install everything at your site root. If, instead, each of these packages is inside it's own "sandbox" and a directional script at the site root points to the bit of software you want. This way, people visiting your domain can just keep linking to your domain and it will all "just work".
For instance, on this site, the WordPress blog is what I'm currently powering the site with. It sits at http://www.wynia.org/wordpress. If I should decide to install Drupal instead or even just to give it a try for a couple of weeks, I can install that at http://www.wynia.org/drupal. If the Drupal installation is just for testing purposes, it will just sit there, unaccessed, unless you know the URL. If you want it to actually be secure, I recommend throwing an .htaccess file with basic or digest authentication in the directory on top of whatever user management the script has.
Once you're ready to make the switch over to the new engine, you change (or if this is the first time, create) the index.php file in your site root. On this site, that's http://www.wynia.org/index.php. What goes in there is nothing other than:
< ?php
header("Location: /drupal");
?>
That little script becomes your "doorman" of sorts, directing unspecified traffic to the appropriate script. Of course, you could make it a little smarter and have it route to 2 different scripts for different browsers or if it's an internal IP address, or if a particular cookie is set, etc.
In short, the structure leaves your site root entirely uncluttered, scripts can be blown away with no extra work beyond dumping the database tables and deleting the directory. This strategy also works for radical upgrades, letting you run the new version in parallel, just renaming the directories or changing the doorman when it's time to switch over. It's really a smaller version of the dev->test->staging->production cycle of servers/sites that most Fortune 500 web projects go through and eliminates doing things like accidentally screwing up your live site.
