title: Laravel API routes 404 error using Heroku Apache
body: <p>I am setting up my Laravel API on Heroku. Everything seems to be working fine, I am able to go to the site and see the Laravel public page. But when I try to access my API routes (signup, login, etc.), it returns a 404 error.</p>
  
  <p>The routes work fine on my own virtual hosts that I created but once I uploaded it to Heroku, all the routes except for "/" return 404. I've checked to see if "index.php/" would work but still returns a 404. </p>
  
  <p>public/htaccess</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews -Indexes
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      # Handle Authorization Header
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  
      # Redirect Trailing Slashes If Not A Folder...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} (.+)/$
      RewriteRule ^ %1 [L,R=301]
  
      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  
          RewriteCond %{REQUEST_URI} 1^public
          RewriteRule ^(.*)$ public/$1 [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Procfile</p>
  
  <pre><code>web: vendor/bin/heroku-php-apache2 public/
  </code></pre>
  
  <p>routes/api.php</p>
  
  <pre><code>$api = app('Dingo\Api\Routing\Router');
  $api-&gt;version("v1", function ($api) {
      $api-&gt;get("/", function () {
          return response()-&gt;json([
              'status' =&gt; 'success'
          ], 200);
      });
  
      $api-&gt;post("/signup", "MusicShare\Http\Controllers\AuthController@signup");
  })
  </code></pre>
  
  <p>Heroku logs</p>
  
  <pre><code>2019-06-16T23:04:37.778061+00:00 app[web.1]: 10.35.223.16 - - [16/Jun/2019:23:04:37 +0000] "GET /index.php/routes HTTP/1.1" 200 47843 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36
  </code></pre>
  
  <p>My Heroku logs do not return an error. Everything shows the status code as 200 but I still get a 404 in Chrome if I try to access "/api/signup" or "/signup" or "/index.php/signup"</p>