So imagine you have a subdomain:
subdomain.example.com/myblog/my/entry/
but sometimes, someone can go and browse the directory and not the subdomain, you ask why don't let them? Well one thing is, that statistics in CPanel are different, it logs for example.com net as I understand and not for that subdomain, some scripts my not work, even PHP, due to you set some URL value, another issue is that when browsing a subdomain, you have different DOCUMENT ROOT's, different $_SERVER; tag values SERVER NAME, HTTP HOST and etc. sometimes it can break something and I guess there are more problems..
so when they enter: example.com/subdomain/myblog/my/entry/
It might work, if you program in a good, why, usually it can break, why would you need some extra errors in the error log? My solution is to use .htaccess file with this code:
CODE
redirect permanent /subdomain http://subdomain.example.com
Because it's permanent, most search engines will continue to browse the subdomain and will leave hitting the directory, besides you won't get any extra logs, because it's a htaccess redirection, the nice thing is that even though you entered:
example.com/subdomain/myblog/my/entry/
it will redirect to a normal url:
subdomain.example.com/myblog/my/entry/
So this is really good, if you have old links somewhere pointing to the directory url and even search engines will re index, of course some older or more less intelligent crawlers might not like the redirect, but most of them should understand the redirect.
In addition, you can use apache {HTTP_HOST} and etc. to make the same "script" work without needing to rewrite it, but I left it in that mode, because imagine this kind of situation, that you have a subdomain.astahost.com and you're using an example.com as an Addon domain, which in fact is just a parked domain over example.subdomain.astahost.com that’s why your condition wouldn't work with HTTP HOST if somebody would enter an url:
subdomain.astahost.com/example/
Because the HTTP HOST would be subdomain.astahost.com, but you want him to point to example.com or even to another-subdomain.example.net which, that’s why the code can't have HTTP HOST and needs to be written like:
CODE
redirect permanent /example http://example.com
To conclude, be careful where you put that .htaccess that you wouldn't get a never ending redirection, the best place is in the folder/directory from which you want to redirect. Moreover, it think it's a much better solution when doing it with PHP or Meta tags or JS, much faster.

