Remove index.php from URL, Laravel 5.2
<p>I saw a lot of examples and tried a lot of solutions without success!
I am trying to put my project to Ubuntu server with apache.</p>

<p><strong>everything its ok when I do :</strong></p>

<pre><code>"/MYEXAMPLE/public/index.php/dashboard" 
</code></pre>

<p><strong>But I want:</strong></p>

<pre><code>"/MYEXAMPLE/public/dashboard"
</code></pre>

<p>And there is the problem!</p>

<blockquote>
  <p>"The requested URL /MYEXAMPLE/public/dashboard was not found on this server."</p>
</blockquote>

<p>My <strong>apache server</strong> has de mod_rewrite. </p>

<p>My project folders are:</p>

<pre><code>     - MYEXAMPLE
     --------- server.php
     --------- public
     ----------------.htaccess.php 
     ----------------.index.php 
     ---------------- views
</code></pre>

<p>My .htaccess.php:</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}]
</code></pre>

<p></p>

<p>INDEX.PHP:</p>

<pre><code>&lt;?php //


require __DIR__ . '/../bootstrap/autoload.php';


$app = require_once __DIR__ . '/../bootstrap/app.php';


$kernel = $app-&gt;make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel-&gt;handle(
        $request = Illuminate\Http\Request::capture()
);

$response-&gt;send();

$kernel-&gt;terminate($request, $response);
</code></pre>

<p>I do not want to remove my views from public folder! When I use wamp server, everything ok, I do not need to use the index.php at the URL. Now I am trying to use the Ubuntu server, but the URL's are not working because I need index.php</p>

<p>Other example: If I access </p>

<pre><code>/MYEXAMPLE/public/
</code></pre>

<p><strong>OR</strong></p>

<pre><code>/MYEXAMPLE/public/index.php
</code></pre>

<p>It goes to homepage as I want. The problem his when I am trying to change to other page!</p>

<p>Any sugestions to solve the problem? Why everything is ok running with wamp and when I try to use the Ubuntu server, I need the index.php at the URL?</p>

<p>Thanks in advance</p>