Answer the question
In order to leave comments, you need to log in
How to make dynamic subdomains on local machine?
Actually the question is higher. In the "hosts" file * does not help.
Answer the question
In order to leave comments, you need to log in
You can set up htaccess and programmatically monitor addresses :)
You need to set up a virtual host on the server:
VirtualHost.....
...
ServerAlias *.yourdomain.ru
...
/VirtualHost
Then .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([ a-zA-Z]+\.)?yourdomain\.ru
RewriteRule ^(.*) index.php?d=%1 [L]
And catch, for example, from php (vasiliy.yourdomain.ru):
echo $_GET ['d'] ; // vasiliy
Didn't check if it works, but you'll figure it out there :)
ps this is for apache
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question