I use MAMP ( Mac OS ). At the end of httpd.conf
added the following:
UseCanonicalName Off <VirtualHost *:80> ServerName loc ServerAlias *.loc VirtualDocumentRoot /Volumes/HDD/Sites/%1 </VirtualHost>
But when trying to knock on mysite.loc (there is such a folder mysite
) says that the web page is not available. The vhost_alias
module vhost_alias
enabled. What am I doing wrong?
Update
Understood. It was necessary to register the address in /etc/hosts
. However, I wanted to achieve the automatic addition of subdomains or even domains (without manipulating the hosts). Is it possible to achieve such a result with Apache manipulations? Or is it necessary to conjure with DNS ?