title: Making use of the base path in Laravel 5 (Lumen)
body: <p>I am using laravel in a project. On my local machine the server I have to access is just</p>
  
  <p><code>laraveltest.dev</code>. When I open this URL the project works fine and without problems.</p>
  
  <p>However, when I upload this on a testing server, where the stuff is located in a sub-foder, like this: <code>laraveltest.de/test2/</code>. The public folder is at <code>laraveltest.de/test2/public/</code>, but when calling <code>laraveltest.de/test2/public</code> the application always returns an 404 error.</p>
  
  <p>I thought this might be because of the base path, so I did the following in the <code>bootstrap/app.php</code></p>
  
  <pre><code>$app = new Laravel\Lumen\Application(
      realpath(__DIR__.'/../') . env('APP_BASE_PATH')
  );
  </code></pre>
  
  <p>where <code>env('APP_BASE_PATH')</code> is the subfolder.</p>
  
  <p>So <code>app-&gt;basePath()</code> returns <code>/var/www/laraveltest/test2/public</code>. However, when now opening</p>
  
  <p><code>laraveltest.de/test2/public</code> I'm always getting the 404 error and I don't know why. What am I doing wrong?</p>