GPicazo
GPicazo

Reputation: 6676

Laravel Public Folder

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?

Upvotes: 6

Views: 10991

Answers (1)

cborgia
cborgia

Reputation: 1419

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

Upvotes: 6

Related Questions