Avoid public folder of laravel and open directly the root in web server

前端 未结 9 2131
礼貌的吻别
礼貌的吻别 2020-11-29 16:45

I was going through all possible sample on internet to solve this. Still it is an headache.

I just want to avoid the \'public\' in www.mylaravelsite.com/public

9条回答
  •  醉话见心
    2020-11-29 17:46

    Here is the solution, But Must not do it in real projects, it is just for starter to test Laravel and i have tested it with laravel 5.0 and it is ,cut index.php and .htaccess files from public folder and paste it in the root directory and change these two lines as

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

    It is Highly Recommended not to use the above method without testing environment, and should use virtual host instead.

提交回复
热议问题