i using laravel 5.4 .(apache 2.4.8)
/etc/hosts:
127.0.0.1 project.local
/etc/apache2/sites-available/project.conf
<virtualhost *:80> documentroot /var/www/html/project/public servername project.local serveralias *.project.local <directory /var/www/html/project/public> options indexes followsymlinks allowoverride order deny,allow deny allow </directory>
commands:
sudo nano /etc/hosts sudo nano /etc/apache2/sites-available/project.conf sudo a2ensite project.conf sudo service apache2 reload
project.local ~> works
somesubdomain.project.local or www.project.local ~> not working .
any ? thanks.
you still need add entry in hosts file every subdomain want hit:
/etc/hosts
127.0.0.1 project.local www.project.local somesubdomain.project.local
please note hosts file not support wildcard domains. example:
127.0.0.1 *.project.local # not work
there answer on stackoverflow here suggests using dnsmasq achieve trying do. otherwise may want consider setting dns server. (see bind or powerdns). depending on how network access have, router may able out too.
Comments
Post a Comment