Assume I have a sub-domain set up as "sub.example.com". However, someone could get to the page via "www.example.com/sub", but I do not want to allow that. Presumably there is a way I could use .htaccess with a mod_rewrite or whatever to redirect a "example.com/sub/index.php" or "www.example.com/sub/index.php" to go to "sub.eample.com/index.php", but my brain is fried right now and my Googling mojo has failed me. (Simply rejecting the "(www.)?example.com" domain would also be acceptable: it's not a case where I need to worry about 301 permanent redirects or any such thing, as it's a new beta test site, so I'm not worried about search engines or old bookmarks and such.)
Hopefully there's an Apache expert out there who already knows the magic syntax and can help this lazy coder.