There are 4 steps:
1. Set up an error document in your .htaccess file that redirects every single 404 to a file called maybe redirection.php
2. Add a wildcard DNS record in your zone files, so that [whateverhere].yourdomain.com points to the domain IP.
3. Add a wildcard serveralias in your apache configs by using:
ServerAlias *.yourdomain.com
4. Write the following code in your redirection.php file
<?
$url=$_SERVER["REQUEST_URL"];
$newurl=str_replace(".yourdomain.com","",$url);
$newcomplete="http://yourdomain.com/".$newurl;
Header("Location: ".$newcomplete);
?>
So when someone enters a subdomain, let's say myself.yourdomain.com they get redirected to yourdomain.com/myself.