As inspired by CI ,
1. Create a “system” folder in root.
2. Move all the files to system except the public folder.
3. Move all the files form public to root folder.
It should now looking something like attached screen shot below.
4. Reconfigure the paths
laravelfiles/bootstrap/paths.php
'app'
=> __DIR__.
'/../app'
,
'public'
=> __DIR__.
'/../public'
,
Change these two lines to:
'app'
=> __DIR__.
'/../app'
,
'public'
=> __DIR__.
'/../../'
,
Find these lines in index.php
require
__DIR__.
'/../bootstrap/autoload.php'
;
$app
=
require_once
__DIR__.
'/../bootstrap/start.php'
;
And change to:
require
__DIR__.
'/system/bootstrap/autoload.php'
;
$app
=
require_once
__DIR__.
'/system/bootstrap/start.php'
;
Now time to remove index.php form url
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Cheers enjoy.
It works 🙂 now i can browse without using /public
Removing index.php is not working.
what is your error?
try composer dump-autoload
try composer dump-autoload
Hay I try this solution before but I got a lot of problems with composer.json, artisan
Above fix is for early version of Laravel.. I guess there are better options for new version of Laravel.
For local : php artisan serve
For production use .htacess
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
Hope this will help