there
I just created a new project in laravel 5.2. then I had successfully removed public/index.php
from url of my project in windows it works fine.
But While I copied the same project in ubuntu inside var/www/html as /var/www/html/myproject
. And enabled apache2 rewrite_mode. But it no work without putting index.php in url. It works without public only.
http:://localhost/myproject/index.php/cms
(it works fine) BUT
http:://localhost/myproject/cms
(it does not works)??? .Any suggestion????
my code is as
route.php
define( "PREFIX", "cms" );
Route::get(PREFIX . '/login', 'Auth\AuthController@getLogin');
it fine also I already cut all files from public folder to root directory and edit index.php file as
require __DIR__.'/../bootstrap/autoload.php';
By
require __DIR__.'/bootstrap/autoload.php';
and
$app = require_once __DIR__.'/../bootstrap/app.php';
by
$app = require_once __DIR__.'/bootstrap/app.php';
.htaccess as
<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}]
</IfModule>