If I understood you well you dont want to have this type of links:
Is this right?
If this is the point I recommend you to build one of this two systems:
1.- Make the link look like this:
affID.example.com -> 12345678.example.com
And make a subdomain catch-all DNS entry, in the handler script get the HTTP_HOST and extract affID, then 302 redirect to www.example.com using PHP header('Location: www.example.com');
2.- Make the link look like this:
And make an .htaccess file to Rewrite internally to some handler script (handler.php?affID=12345678) that 302 redirects to main site.
This are just two ideas I just came with, if someone sees some PROs/CONs regarding SEO (redirecting issues, etc...) please discuss here so we can come with a good affID URL system.