Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Public Folder

Tags:

php

laravel

I was wondering if someone could shed some light as to why the index.php file for a laravel application lives in the public directory. What are the risks if I were to move it into the root directory instead?

like image 956
GPicazo Avatar asked Sep 28 '12 18:09

GPicazo


1 Answers

The files and folders in laravels public folder are meant to be web accessible. For security, all other files and folders in the laravel framework should not be web accessible.

Moving the index.php to laravels root will break the framework and defy best practices.

Follow these instructions to ensure your servers config points to the public directory for DocumentRoot

like image 114
cborgia Avatar answered Oct 19 '22 23:10

cborgia