One of my websites ignores random subdomains. The site doesn't have any subdomains but it will happily accept URLs such as fjiddifjdskdjf.example.com or dsfkljsdflsdjfds.example.com.
In both cases, it will display the home page. Similarly, I can log in at sfkjsdidisfdj.example.com/user.
At first, I suspected the problem was with a .htaccess file I put in the root directory. The file is used to redirect URLs that changed when I redesigned the website. It's got entries like this.
RedirectMatch 301 ^/2012/06/$ /blog/201206
However, after renaming the file, it's still accepting these odd, random subdomains.
I've also checked another Drupal site I maintain. On that site, entering a non-existent subdomain results in an 404 error. I've compared both sites' standard .htaccess files and they're identical. Both sites use the same (shared) hosting package, which should rule out differences in how the server has been configured.
Why URLs with non-existing subdomains don't trigger an error? How can I correct this behaviour?