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.
everything its ok when I do :
"/MYEXAMPLE/public/index.php/dashboard"
But I want:
"/MYEXAMPLE/public/dashboard"
And there is the problem!
"The requested URL /MYEXAMPLE/public/dashboard was not found on this server."
My apache server has de mod_rewrite.
My project folders are:
- MYEXAMPLE
--------- server.php
--------- public
----------------.htaccess.php
----------------.index.php
---------------- views
My .htaccess.php:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
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}]
INDEX.PHP:
<?php //
require __DIR__ . '/../bootstrap/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
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
Other example: If I access
/MYEXAMPLE/public/
OR
/MYEXAMPLE/public/index.php
It goes to homepage as I want. The problem his when I am trying to change to other page!
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?
Thanks in advance