I have set the wildcard DNS for my site and now my DNS is forwarding all requests for
*.domain.com
to
domain.com
What i want in the .htaccess file is that a method to distinguish between the root domain and the dynamic subdomain. if i am using
user1.domain.com
then this should go to
domain.com?users.php?val=user1
and for Other files like the news item the hierarchy should be like
user1.domain.com/news/newsdetails.php
to
domain.com/newsdetails.php?val=user1
and it should not disturb the main root domain like my domain.com/newsdetails.php
shall go to the newsdetails file without the val variable set.
Basically what the idea here is that i should handle the dynamic subdomains rewriting and the main domain files.
EDIT: i also want that if someone enter www.domain.com then it should pick the index file for this request and if its user1.domain.com then it should be another file.
can any body help me in this issue?