Home » » How to remove Public and index from Laravel 5

How to remove Public and index from Laravel 5

Posted by E-Learning on Sunday, May 31, 2015

i'm sorry ,my english is not good
hi,
long time i'm not publish new post on this blog,
yeah, cause i'm have not enaugh more time.

let's go,
if you use laravel, u can get uri use /public/index.php in your browser. my opinion this uri is very disturb to me, i must open new function with /public/index.php/function.

to remove it.
open file index.php in directory laravel, modification line 21 replace with :


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

and then modification line 35 replcae with :

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


step two ( on linux )

load modul mod_rewrite

sudo a2enmod rewrite

edit file default on directory /etc/apache2/sites-available/

nano /etc/apache2/sites-available/default

replace all directive AllowOverride None to AllowOverride All

and the last, restart web server apache

sudo /etc/init.d/apache2 restart

save file, and you got succes :D




Hosting Unlimited Indonesia

0 comments:

Donate Bitcoin :
19QsXRcfUEKW9AVbGkJFB6WJPvn6uRboNr