In Laravel 5.4 I want to create dynamically subdomain.
According to This Answer in SO I followed this instructions to do that:
First I downloaded and installed Acrylic DNS Proxy program. then I added this line at end of Acrylic Host file like this:
127.0.0.1 *.loverspay.dev loverspay.dev
And added this to httpd-vhosts in apache extra directory:
<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot 'd:/wamp/www/loverspay/public'
ServerName loverspay.dev
ServerAlias *.loverspay.dev
<Directory 'd:/wamp/www/loverspay/public'>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Also I changed Preferred DNS Server to 127.0.0.1 in Local Area Connection Properties.
And this is my route to control wildcard subdomain that should show main
route in larvel :
Route::group(['domain' => '{account}.loverspay.dev'], function ($account) {
Route::get('/', function ($account, $id) {
return view('home');
});
});
Now after starting acrylic DNS proxy when I go to loverspay.dev
all things worked find But when I want to open ahmad.loverspay.dev
for example only a This site can’t be reached
message shown in chrome.