samedi 9 novembre 2019

Laravel subdomain routes does not work with wildcard domain

I know it's simple but .I am facing issue with maindomain and with subdomain.I have two Group route. subdomain group route does not work.

 Route::group(['domain' => '{name}.'.env('APP_DOMAIN')], function () {
        Route::get('/', function ($name) {
           echo $sub1." Site";
           //Prints sub1 Site when visiting sub1 and sub2 site when visiting sub2
           die;
       });
    }); 
    Route::group(['domain' => env('APP_DOMAIN')], function () {
        Route::get('/', function () {
            echo 'Main Site';
            die;
        });
    });

Problem is that, when I use sybdomain , sanjay.example.com it's print Main site ,same for main site exampple.com .I do not know where I am wrong . subdomain route is not working. I am using wildcard domain . Any help will be save me .

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire