title: How can I fix Laravel 5.1 - 404 Not Found?
body: <p>I am trying to use Laravel 5.1 for the first time. I was able to install it and <code>https://sub.example.com/laravel/public/</code> is displaying what is should. However, views I create are giving me a 404 error Page not found.</p>
  
  <p>Here is what I have done so far:</p>
  
  <p>I created a controller in <code>laravel\app\Http\controllers\Authors.php</code></p>
  
  <p>Here is the code behind the <code>Authors.php</code> file</p>
  
  <pre><code>&lt;?php
  
  class Authors_Controller extends Base_Controller {
  
      public $restful = true;
  
      public function get_index() {
          return View::make('authors.index')
              -&gt;with('title', 'Authors and Books')
              -&gt;with('authors', Author::order_by('name')-&gt;get());
      }
  }
  </code></pre>
  
  <p>Then I created a view in <code>laravel\resources\views\Authors\index.blade.php</code></p>
  
  <p>Here is the code behind the <code>index.blade.php</code> file</p>
  
  <pre><code>@layout('layouts.default')
  
  
  @section('content')
      Hello, this is a test
  @endsection
  </code></pre>
  
  <p>Then I created a layout in <code>laravel\resources\views\layouts\default.blade.php</code></p>
  
  <p>Here is the code behind the <code>default.blade.php</code> file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;{{ $title }}&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      @if(Session::has('message'))
          &lt;p style="color: green;"&gt;{{ Session::get('message') }}&lt;/p&gt;
      @endif
  
      @yield('content')
      Hello - My first test
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Finally I created a route in <code>laravel\app\Http\routes.php</code></p>
  
  <pre><code>&lt;?php
  Route::get('/', function () {
      return view('welcome');
  });
  
  Route::get('authors', array('as'=&gt;'authors', 'uses'=&gt;'authors@index'));
  </code></pre>
  
  <p>But for some reason I keep getting 404 error Page not found.</p>
  
  <p>I enabled the mod_rewrite on my Apache 2.4.9 by uncommenting out the line</p>
  
  <pre><code>LoadModule rewrite_module modules/mod_rewrite.so
  </code></pre>
  
  <p>Then restarted Apache.</p>
  
  <p>From what I can tell in the <code>php_info()</code> output the mod_rewrite is enabled</p>
  
  <pre><code>Loaded Modules 
  core mod_win32 mpm_winnt http_core mod_so mod_php5 mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl 
  </code></pre>
  
  <p>My current .htaccess file looks like this "which is the factory default"</p>
  
  <p>
      
          Options -MultiViews
      </p>
  
  <pre><code>RewriteEngine On
  
  # Redirect Trailing Slashes If Not A Folder...
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)/$ /$1 [L,R=301]
  
  # Handle Front Controller...
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
  </code></pre>
  
  <p></p>
  
  <p>I have also tried to change it to the code below as per the <a href="http://laravel.com/docs/5.1" rel="nofollow noreferrer">documentation</a>:</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
  </code></pre>
  
  <p>However, I am still getting the 404 page when I go to</p>
  
  <pre><code>https://sub.example.com/laravel/public/authors
  </code></pre>
  
  <p>What am I doing wrong?
  How can I fix this problem?</p>