Monday, February 12, 2018

Laravel main domain routes works for subdomain - development

Laravel main domain routes works for subdomain

When I open test.example.com/main I expect a 404 error because this route is not defined in subdomain routes. but main domain routes works for subdomain. So route Route::get('/main' ... runs

My routes/web.php :

Route::domain('test.example.com') -> group(function () {
    Route::get('/sub', function(){
        return view('sub.index');
    });
});

Route::get('/main', function(){
    return view('main.index');
})



from Laravel Questions and Answers https://laravelquestions.com/php/laravel-main-domain-routes-works-for-subdomain/
via Lzo Media

1 comment: