title: Why does Route::domain cause a 404 in Laravel on every route, including subdomains?
body: <p>All my routes stopped working recently and I've narrowed it down to my <code>RouteServiceProvider.php</code> file. The reason is that I have <code>Route::domain</code> for the Web routes is for the main domain, while others are for specific subdomains.</p>
  <p>If I don't have a <code>Route::domain</code> on the Web routes, it will make all subdomain routes act as if they were from the Web routes.</p>
  <pre class="lang-php prettyprint-override"><code>public function boot()
      {
          $this-&gt;configureRateLimiting();
  
          $this-&gt;routes(function () {
              // Hub Routes
              Route::domain('hub.' . config('app.url'))-&gt;middleware('web')-&gt;name('hub.')-&gt;group(base_path('routes/hub.php'));
  
              // Dashboard Routes
              Route::domain('dashboard.' . config('app.url'))-&gt;middleware('web')-&gt;name('dashboard.')-&gt;group(base_path('routes/dashboard.php'));
  
              Route::middleware('api')
                  -&gt;prefix('api')
                  -&gt;group(base_path('routes/api.php'));
  
              Route::domain(config('app.url'))-&gt;middleware('web')-&gt;group(base_path('routes/web.php'));
          });
      }
  </code></pre>
  <p>What is causing this?</p>