title: Laravel project in subfolder of public_html gives trouble with .htaccess redirect
body: <p>I've set up my VPS server and am trying to set up a Laravel project.
  I have a <code>/public_html/</code> folder with an index.html that's shown when visiting the website URL.</p>
  
  <ul>
  <li>I have a laravel project in: <code>/public_html/project_one/</code></li>
  <li>The original index.php is located in <code>/public_html/project_one/public/index.php</code></li>
  </ul>
  
  <p>I want the website to show to Laravel project_one by default, but since yesterday I literally googled this for 4 hours, I tried every solution on stackoverflow, nothing worked... I think I've tried over 10 versions of .htaccess I could find.</p>
  
  <h1>The question:</h1>
  
  <p><strong>Does anyone know how to setup the .htaccess inside <code>/public_html/</code> so it redirects to my Laravel project?</strong></p>
  
  <p>I though I needed to upload my Laravel folder in: <code>/public_html/project_one/</code> but is there a better location?</p>
  
  <p>I want the main url to show the Laravel project. So <code>www.mainurl.com</code> is Laravel's <code>project_one/public/index.php</code> file. I do not want <code>/project_one/</code> to be written in the URL!</p>
  
  <p>Just out of curiosity, if I now visit: <code>www.mainurl.com/project_one</code> I get a <em>403 forbidden.</em></p>
  
  <h1>Failed solutions</h1>
  
  <p>In /public_html/ I tried to add .htaccess with:</p>
  
  <pre><code>DirectoryIndex index.php
  
  #Redirect to /project_one/public if you haven't already and the IP is okay
  RewriteCond %{REMOTE_ADDR} ^1\.2\.3\.4*
  RewriteCond %{REQUEST_URI} !^/project_one/public
  RewriteRule ^(/lucaphoto)?(.+) /project_one/public$2 [L]
  
  #if IP does not match and you ARE in the folder, then Redirect to root
  RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4*
  RewriteCond %{REQUEST_URI} ^/project_one/public
  RewriteRule .? / [R=301,L]
  </code></pre>
  
  <p>This gives me something really strange:</p>
  
  <ol>
  <li><strong>On Chrome:</strong> it redirects me to www.mainurl.com/project_one -> And then gives me a 403 forbidden error.**</li>
  <li><strong>On safari:</strong> it redirects me nowhere but gives me this error:</li>
  </ol>
  
  <blockquote>
    <p>Forbidden. You don't have permission to access / on this server.</p>
    
    <p>Additionally, a 404 Not Found error was encountered while trying to
    use an ErrorDocument to handle the request.</p>
  </blockquote>
  
  <h1>Laravel's original .htaccess File</h1>
  
  <p>By the way, Laravel has an original .htaccess file at <code>/project_one/public/.htaccess</code>. And it looks like this:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews
      &lt;/IfModule&gt;
  
      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]
  
      # Handle Authorization Header
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  &lt;/IfModule&gt;
  </code></pre>