I want to assign a Specific subdomain to each user after registration based on her Username on the local wampServer for a domain like tc.dev
I've done all steps that been said in This Topic or other similar topics on the web.
This is configuration that i added to httpd-vhosts.conf file:
<VirtualHost *:80>
DocumentRoot "D:/wamp/www/tc/public/"
ServerName tc.dev
ServerAlias *.tc.dev
<directory "D:/wamp/www/tc/public/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
And this is what I added to C:\Windows\System32\Drivers\etc\hosts file :
127.0.0.1 tc.dev
127.0.0.1 *.tc.dev
and this is My route :
Route::group(['domain' => '{account}.tc.dev'], function () {
Route::get('/', function ($account, $id) {
return view('main.pages.user.index');
});
});
tc.dev
works fine but any subdomain that I test does not work and index
view not shown.
what is problem and solution?
Update:
According to Wildcards in a Windows hosts file , now sub-domain works as main domain But based on route that I wrote main.pages.user.index
does not show and index.php
file in DocumentRoot "D:/wamp/www/tc/public/"
Is shown.
It seams this route does not consider.