By netbjarne on
I have an odd problem. The content of my site (mydomain.com/content) is shown regardless of what subdomain one enteres (randomstuff.mydomain.com/content)..
Once i had a drupal installation at sandbox.mydomain.com, now its gone in favour of the real site mydomain.com - but google and other searchengines picked up the testsite, and now prefers to index content from the sandbox subdomain. I don't know it this is a hosting or some htaccess issue, but I really would like the url "your-are-a-nitwit.mydomain.com" to return a 404 instead of my content before someone finds out and points google to all sorts of "fun" subdomains ...
Bjarne
Comments
This is a hosting issue,
This is a hosting issue, guess they made a VirtualHost with ServerName/ServerAlias *.mydomain.com pointing to the mydomain.com root folder.
You can make a small module where you in the hook_init() get global $base_root and split it with parse_url() and validate the domain name as you like and use drupal_not_found() to show them the drupal 404 error page if you wont let them access.