Skip to main content

Web Root

hosting

The web root is the top-level directory the web server reads files from for a site — on cPanel accounts usually public_html. Files outside the web root cannot be reached by a browser, which is the right place for configuration and credentials.

Keep backups, logs and .env files outside the web root so they are never downloadable.

Placing a database dump in public_html instead of the home directory would expose it to anyone who guesses the URL.

Related topics

Frequently asked question

What is Web Root?

The web root is the top-level directory the web server reads files from for a site — on cPanel accounts usually public_html. Files outside the web root cannot be reached by a browser, which is the right place for configuration and credentials. Keep backups, logs and .env files outside the web root so they are never downloadable.

Read the full answer