laravel

Removing /public/ folder from Laravel


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.

Screen Shot 2014-08-22 at 1.21.11 PM

 

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.