Support the ongoing development of Laravel.io →
Routing Laravel
Last updated 2 years ago.
0
moderator Solution

I think this is the part that result in your problem:

Route::group(array('domain' => '{account}.' . $siteUrl), $subdomainRoutes);
Route::group(array('domain' => $siteUrl), $mainRoutes);

You can try to create a regular expression constraint for the account variable, see: https://laravel.com/docs/9.x/routing#parameters-regular-expression-constraints

Or maybe a more uggly way that can possible help:

Route::group(array('domain' => 'www.' . $siteUrl), $mainRoutes);
Route::group(array('domain' => '{account}.' . $siteUrl), $subdomainRoutes);
Route::group(array('domain' => $siteUrl), $mainRoutes);

I didn't test the options so maybe it doesn't work.

rassemdev, driesvints liked this reply

2
Solution selected by @rassemdev

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.