Thanks for the response.
I am trying to do the whole work. Actually I did not use so much coding until this point, but I could progress a lot.
I checked the link you’ve sent me. However, I think that the most important thing I’m trying to do is missing there.
The crucial thing here is that the subdomains and that index page(so actually whole content) of my site will only be available for my users. So if someone tries to access directly to a.example.com(example from my first post), I must direct him/her to my login and registeration page, so if he/she wants to access a.example.com, either will login or register. Otherwise will have to leave 🙂 Am I clearer now?
So if you understood what I’m trying to do, maybe you can tell me what should I do step-by-step.
Thanks for your attention.