Skip to main content

Document Root

hosting

The document root is the directory on the server that a domain serves files from, typically public_html. Pointing a domain's document root at the right folder is what makes a site appear at its URL.

Laravel apps should point the document root at the /public directory, not the project root, so the .env file is never web-accessible.

Changing a staging site's document root from /staging to /public_html is how the new version goes live.

Related topics

Frequently asked question

What is Document Root?

The document root is the directory on the server that a domain serves files from, typically public_html. Pointing a domain's document root at the right folder is what makes a site appear at its URL. Laravel apps should point the document root at the /public directory, not the project root, so the .env file is never web-accessible.

Read the full answer