In IIS, I have a subdomain: sub.mydomain.com
BUT, if someone incorrectly types it as: www.sub.mydomain.com it doesn't work.
How do I resolve this issue?
With IIS6 you cannot create wildcard subdomains, you will have to use DNS (or ISAPI rewrite) to handle *.sub.mydomain.com.
For more information on wildcard subdomains and windows you can actually use ServerFault ;-). See this post here: Wildcard DNS and subdomains
For more information on ISAPI rewrite you can use the following page: Creating Dynamic Subdomains in IIS using ISAPI_Rewrite