My current ISP has enabled wildcards for subdomains within our domain.
i.e. *.testdomain.com would be redirected to http://www.testdomain.com
My problem is that I dont have any subdomains established yet. But I cant turn off subdomain functionalities due to ISP's control. So if I have a malicious user and wants to post something on a website and for a joke, they can post a link pornmaster.testdomain.com and if somebody clicks on it, my site www.testdomain.com pops up. How do I prevent this from happening?
my domains are testdomain.com, .net, .org
My site can be reached by using with or without www i.e. testdomain.com or www.testdomain.com
Now I am a newbie and all these rewrite syntax is really confusing.
1. If the user request testdomain.com or .net or .org with and without the www preceding it, it will redirect to testdomain.com main site. But, if the www is missing and they put something in the subdomain area ie. pornmaster.testdomain.com, I want the user to get a forbidden code or page does not exist. How do I make a rule from preventing somebody using subdomains?
2. The second question is what if I finally make a subdomain? ie. testing.testdomain.com
What happens then if this is the only subdomain that is valid?
How do I validate that subdomain to be valid while still not letting other fake subdomains through.
Hope this makes sense. Thanks in advance,