title: Laravel 5 routes and mod_rewrite
body: <p>I have a simple <code>routes.php</code> file, that looks like this:</p>
  
  <pre><code>Route::group(['middleware' =&gt; 'cors', 'prefix' =&gt; 'api'], function () {
    Route::post('users', 'Api\UsersController@save');
    Route::get('users/{userId}/leagues/', 'Api\UsersController@saveFavoriteLeague');
  });
  </code></pre>
  
  <p>Once I put my application to server, I couldn't get to any of the routes executed. I was getting 404 exception.</p>
  
  <p>I tried to make an obvious error in <code>routes.php</code> file, by putting <code>123</code> at the top of the file. Then I hit <code>mydomain.com/users/1/leagues</code>, and I was expecting error page, that there is a syntax error, but that didn't happen (still getting 404).
  However, when adding something like this: </p>
  
  <pre><code>Route::get('/', function() {
     return 'Hello';
  });
  </code></pre>
  
  <p>and hitting home route <code>mydomain.com</code>, I was able to see at first syntax error, and then after fixing it, <code>Hello</code>. </p>
  
  <p>I spent hours until I discovered that mod_rewrite, wasn't enabled on the remote server.</p>
  
  <p>Can someone put more light on this?
  Why my requests didn't reach <code>routes.php</code> (not even to show that there is an syntax error), but instead 404 page was returned. Why mod_rewrite made it to work? How could <code>/</code> reached the <code>route.php</code>, but <code>/users</code> e.g. didn't?</p>
  
  <p>Thanks!</p>