i have been trying to create a rule for dynamic sub-domains and tried many rules given by other users. I am able to use dynamic sub-domains and they are working fine now.
My sub-domain structure is sub1.sub2.domain.com
Now i want that when a user goes to sub1.sub2.domain.com then the default page must be code.php and not index.php
Also in address bar only sub1.sub2.domain.com should be visible and not sub1.sub2.domain.com/code.php
Also i have to use two level sub-domains not single sub.domain.com
I just need help in creating the rewrite rule which displays code.php when user accesses sub1.sub2.domain.com
Thank You
You can try this in .htaccess
Edit: In your index.php page, before your HTML try something like this:
This should look at the server name, including sub-domain and work out what to use from there from memory.