Need advice on server settings. I am looking for solutions to the following tasks.

There is a server, say You need to programmatically create (with emulate) a third-level domain (say, without restarting the server. Then, you need to make all requests like:* 

Redirected to:* 

I tried to solve both problems using the .htaccess file. But I could not solve the problem of changing the address bar in the browser. Those. when accessing, redirection to occurred, and this way was displayed in the address bar.

But if you solve the problem of creating virtual hosts by changing the apache settings, you must restart the server, which is unacceptable.

    2 answers 2

    Here, read automatic subdomains .

    • Thank. I will think =) ps How can you express gratitude? Someone even put a “teacher” to me, but I looked hard and did not find any check marks anywhere .. - Vitaly Kustov
    • @Vitaly Kustov If the answer is correct, you can accept it. If the answer, in your opinion, contains useful information, you can add a plus to it. - Nicolas Chabanovsky

    1 no need to restart, just apachectl reload or killall -HUP httpd

    2 lead URL to can be using the system mod_rewrite

    read more: mod_rewrite