Answer the question
In order to leave comments, you need to log in
How to create dynamic subdomains?
Interested in how to create dynamic subdomains on the apache server, for example, for user accounts, for example: username.website.ru
Look towards the rules in .htaccess? Then this is apparently some kind of get parameter, for example, which one from website.ru/index.php?u=username rewrites to username.website.ru - it would not be bad.
I am also interested in the question of the environment, will the standard environment that is on virtual hosting be enough?
Answer the question
In order to leave comments, you need to log in
Surprising fact from the animal world:
For some very strange reason, hamsters cannot live without .htaccess
Without using this web server configuration file, the application seems to them unsolid, incomplete. And they try to shove it wherever they can.
Although it would be worth stopping for a minute and just thinking - is he needed here at all? What problem are we going to solve with it? Does it exist at all - is this a problem?
1) Add a wildcard (*.example.com) in your domain DNS settings so that any subdomain goes to the main one
2) In the web server settings, set the virtualhost * so that all requests are processed by the same virtualhost.
3) EVERYTHING. Do not need anything else. Everything is ready and working.
1) Add a wildcard (*.example.com) in your domain DNS settings so that any subdomain goes to the main one
2) In .htaccess add the rule subd.example.com => example.com/index.php?section=subd
3) On this will work for most hosts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question