Website Without PHP
English (United States)US
  • English (United States)
  • English (United Kingdom)
  • Dutch (Netherlands)
  • Dutch (Belgium)
Menu

Document root

The document root is the base directory from which a web server can serve files for a website.

Read the explanation

Hosting and infrastructure Last updated:

The document root is the base directory from which a web server can serve files for a website. This term helps when files have been published but your website still shows different content. Start by asking which directory belongs to the intended domain.

Do not move files based on a familiar folder name. Ask the administrator to confirm the connection and record which environment you are trying to view before deciding what needs changing.

How does the server use this directory?

The Apache documentation on URL mapping describes DocumentRoot as the base used for the usual mapping from a requested path to a file. Apache can use different roots for virtual hosts. This is the specific example in this article.

For other server products, ask the administrator to identify the corresponding setting.

The web serverA web server is the program, such as Apache, Nginx or LiteSpeed, that answers when a visitor opens your site and sends back the page and files. determines how requests are handled, with the document root forming part of that arrangement. Apache also documents other forms of mapping and redirection. A directory name alone therefore cannot establish where every URL gets its content.

Ask about the route involved in your report rather than assuming that all requests follow the same mapping.

Why does the domain matter?

Which PHP version does your site report?

We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

Include the complete domain nameA domain name is the address people type to reach your website, such as yourcompany.com. It points visitors to wherever your site is hosted., including the subdomain you used. Say whether you are viewing the live website or a test environment. They may look alike to you, while the investigation concerns the connection of a particular name.

Ask the administrator to identify the name that was actually checked in the response.

A useful report might say that a changed page appears on stagingA staging environment is a private copy of your website where you try updates first, so any mistakes happen there and not on the live site. but not on the main domain. Include the URL viewed and the content expected. Have the administrator investigate which directory and further processing belong to that request.

This observation is useful without requiring you to decide in advance which configuration component is wrong.

How do you check a publication?

For a deploymentA deployment is the step that puts a new version of your website live for visitors, ideally automated, tested and easy to undo., agree which visible change you will check afterward. Choose something that identifies the intended release, such as a changed heading or a new page. Ask where that release was placed and how the domain connects to it.

Keep the explanation alongside the result of your check so the two can be compared.

Do not stop at opening the homepage. If the change concerns a particular page or image, view that URL. Report exactly what you see and what you expect.

A working homepage does not establish that the requested file or route is being served. The purpose of the check is to recognize the intended release on the intended website.

What if the content is unexpected?

First establish that you are viewing the right environment. Then request a check of the directory mapping and relevant routing. Do not remove old directories to discover which one is active.

Causing a missing file is not a suitable way to investigate unclear server configuration. An administrator can assess the arrangement directly without using a visitor-facing failure as a probe.

Include when you first noticed the difference and whether the same URL previously worked. This helps connect the investigation with a particular change. After a repair, ask what cause was established.

A statement that the website was published again does not explain why you received the wrong content before that action.

What makes a useful handover?

Keep the domain, checked URL, relevant directory mapping and identified release in an internal maintenance note. Do not publish server paths or configuration details on a public diagnostic page. The owner mainly needs confirmation that the intended content is available through the intended URL.

Detailed server information can remain with the administrator responsible for the environment.

When arranging a PHP migration, include this mapping check in the relocation plan. Test the same pages and user actions afterward. Record remaining differences separately so that a confirmed directory mapping is not confused with evidence that every part of the website has been fully checked.

Frequently asked questions

Is the document root always called public_html?

No. Use the directory configured for your website. A familiar folder name does not prove that the web server uses it.

Is the document root the same as a domain?

No. The domain is the name used to reach the website. The document root is a directory in the server configuration; have their connection checked.

Does the correct root prove every URL works?

No. Other rules can also determine how requests are handled. Check the specific page or action described in the original report.

Share this page

Ask your AI to explain

Opens the chat with a question about this page. An AI answer can differ; the sources above are leading.

This question is sent along: Summarise the confirmed facts on https://websitewithoutphp.com/en-us/glossary/document-root/ in 5 short points, with the source per point.

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

We keep the domain and the result, never your IP address.