vendredi 27 mai 2016

Laravel subdomain route - NotFoundHttpException

I'm working on API in my Laravel project, and have problem with setting up subdomain (Ubuntu).

I set up Virtualhost, Routing, enabled vhost_alias

VirtualHost:

<VirtualHost *:80>
ServerName domain.io
ServerAlias domain.io
DocumentRoot mypath

<Directory mypath>
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

</VirtualHost>
<VirtualHost *:80>
ServerName api.domain.io
ServerAlias api.domain.io
DocumentRoot mypath

<Directory mypath>



            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

</VirtualHost>

My route:

Route::group(['domain' => 'api'.env('APP_HOST')], function() {

    Route::get('test', function() {
        return 'test';  
    });

});

Url http://api.domain.io/ redirect to main domain domain.io. When I visit my route http://ift.tt/1TJhvQy I get error (like there would not be that route):

NotFoundHttpException in RouteCollection.php line 161:



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire