cluel3ss
1 week ago

Why does subdomain route work on production but not on Valet

Posted 1 week ago by cluel3ss

I have a Laravel app which has routes on the base domain, as well subdomains based on a "vanity_url"

Heres an excerpt of what my routes file looks like:

Route::domain('{business:vanity_url}.' . env('APP_BASE_DOMAIN'))->group(function () {
    Route::get('/', '[email protected]')->name('business.landing');
});

Route::get('b/{business:vanity_url}', '[email protected]')->name('business.landing');
Route::get('/', '[email protected]')->name('home');

My APP_BASE_DOMAIN looks like this: APP_BASE_DOMAIN=mysite.xyz on Prod and APP_BASE_DOMAIN=mysite.test

Now when I access avalidvanityurl.mysite.test it redirects to my home route instead of the business.landing route. However on my PROD server avalidvanityurl.mysite.xyz goes to my business.landing route.

Can someone advise why this could be happening?

Please sign in or create an account to participate in this conversation.