title: Problem redirecting to /public folder in a Laravel project on Apache
body: <p>I have the following situation with a Laravel project. I uploaded the project to a Linux Server in the /var/www/html/tup folder.</p>
  <p>I can access the site with the link <a href="http://www.example.com/tup/public" rel="nofollow noreferrer">http://www.example.com/tup/public</a> as shown in this image
  <a href="https://i.stack.imgur.com/Ck9m7.png" rel="nofollow noreferrer">(First Image)</a></p>
  <p>I want to access directly without entering the public in the URL i. e. <a href="http://www.example.com/tup" rel="nofollow noreferrer">http://www.example.com/tup</a></p>
  <p>I tried with a .htaccess file in the main folder of the project:</p>
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  # That was ONLY to protect you from 500 errors
  # if your server did not have mod_rewrite enabled
  
  RewriteEngine On
  # RewriteBase /
  # NOT needed unless you're using mod_alias to redirect
  
  RewriteCond %{REQUEST_URI} !/public
  RewriteRule ^(.*)$ public/$1 [L]
  # Direct all requests to /public folder
  
  &lt;/IfModule&gt;
  </code></pre>
  <p>But when I enter to <a href="http://www.example.com/tup" rel="nofollow noreferrer">http://www.example.com/tup</a> Laravel throws a 404 Not Found error
  <a href="https://i.stack.imgur.com/BPfRI.png" rel="nofollow noreferrer">(404 error Image)</a>. I have to write <a href="http://www.example.com/tup/index.php" rel="nofollow noreferrer">http://www.example.com/tup/index.php</a> for Laravel to redirect me like in <a href="https://i.stack.imgur.com/mUNY6.png" rel="nofollow noreferrer">this image</a>.</p>
  <p>It seems that the index.php file is not being detected</p>
  <p>In the public folder a I have another .htaccess file:</p>
  <pre><code>DirectoryIndex index.php index.html
  &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]
  
      # Send Requests To Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  <p>I already modified the apache2.conf file and set all the AllowOverride to All and enabled mod_rewrite as well.</p>
  <p>I also added this configuration in the apache2.conf:</p>
  <pre><code>&lt;Directory /var/www/html/tup/public/&gt;
      DirectoryIndex index.php
      Options Indexes FollowSymLinks
      AllowOverride All
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  <p>I would greatly appreciate any kind of help.</p>