Laravel 5 – Remove Public from URL

后端 未结 30 1953
甜味超标
甜味超标 2020-11-22 03:20

I know this is a very popular question but I haven\'t been able to find a working solution for Laravel 5. I\'ve been trying to migrate from Codeigniter for a long time, but

30条回答
  •  爱一瞬间的悲伤
    2020-11-22 03:58

    It's possible to remove public url in laravel5. Follow these steps:

    step 1.copy all file from public and paste on root directory

    step 2.open index.php file replace with

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

    to

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

    and

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

    to

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

    And remove all cache and cookies.

提交回复
热议问题