---
title: "Hosting Document360 on a subfolder"
slug: "document360-on-a-sub-folder"
description: "Most companies host their documentation under a sub folder/subdirectory on their website domain.This is because hosting a knowledge base on a subdirectory/sub folder of a website example."
tags: ["Custom domain", "sub directory hosting"]
updated: 2026-06-02T13:57:41Z
published: 2026-06-02T13:57:41Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.document360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hosting Document360 on a subfolder

## What is subfolder hosting?

**Subfolder hosting** is the method of organizing and displaying content on a website using folders under the main (root) domain. A **subfolder** (also called a **subdirectory**) appears **after the root domain** in a URL and is used to structure content logically. For example, Document360’s root domain is `document360.com`. So, a subfolder/subdirectory path URL might be `document360.com/docs/`.

Most companies host their documentation under a subfolder/subdirectory on their website domain. For example: `example.com/docs`, `example.com/support`, etc.

This is because hosting a knowledge base on a subdirectory/subfolder of a website (`example.com/docs`) rather than a subdomain (`docs.example.com`) is better for Search Engine Optimization (SEO).

> [!NOTE]
> ** NOTE
> 
> Subfolder/subdirectory hosting can be enabled for **Document360 provided domains** and mapped **custom domains**.

---

## Enabling subfolder hosting

To enable the subfolder hosting for your project,

1. Navigate to **Settings** (**) > **Knowledge base site** in the left navigation bar in the **Knowledge base portal**.
2. In the left navigation pane, navigate to **Custom domain**.
3. On the **Custom domain** page, navigate to the **Subfolder hosting** tab.

By default, the Subfolder path is set to **/docs**.
4. Turn on the toggle next to **Knowledge base is hosted as a subfolder**. When the toggle is turned on, the public preview of articles will be visible. This also prevents insertion of the workspace slug when inserting links in articles.

![Settings for custom domain mapping and subfolder hosting in knowledge base portal.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/subfolder%20hosting.png)

> [!NOTE]
> ** NOTE
> 
> Subfolder hosting is currently supported only for public knowledge base projects. For private or mixed-access projects, subfolder hosting is not supported because users are redirected to the Document360 identity login page for authentication, which cannot be proxied through a customer’s server. As a result, subfolder hosting cannot be used for projects that require sign-in.

### Custom Subfolder paths

You can also set up your knowledge base on subfolder/subdirectory paths other than `/docs`.

For example, `/help`, `/support`, etc.

1. Navigate to **Settings** (**) > **Knowledge base site** in the left navigation bar in the **Knowledge base portal**.
2. In the left navigation pane, navigate to **Custom domain**.
3. By default, the **Subfolder path** is set to **/docs**.
  1. On the **Custom domain** page, navigate to the **Subfolder hosting** tab.
4. Clear the **Subfolder path** field and enter your custom subfolder path (**For example,** `/help`).
5. Click the **Update** button on the right.

This new custom subfolder will only work if the subfolder hosting setting is enabled in your project.

When setting up other paths, add the languages associated with each workspace in your project. This configuration varies depending on the different web servers.

> [!NOTE]
> **** NOTE**
> 
> For projects configured with custom domain and subfolder hosting, the **Article preview** option is not supported yet.

If you’ve defined a custom Subfolder path, don’t forget to configure your server to proxy requests for this path. You can refer to the platform-specific server articles for guidance.

![Custom domain mapping settings for subfolder hosting and API path configuration.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/subfolder%20path.png)

### Custom Site API paths

> [!TIP]
> ** For your information (FYI)
> 
> The Custom Site API paths feature is available only in KB site 2.0 projects. To migrate from KB site 1.0 to KB site 2.0, read the article on [KB site 2.0 migration](/help/docs/kb-site-20-migration).

By default, the Site API path is set to `/api`. You can customize the **Site API path** as well from the **Subfolder hosting** tab in the custom domain settings.

For example, `/docs-api`, `/api-docs`, etc.

After setting the Site API path, you must also configure a matching location block on your web server (such as `/api`, `/docs-api`, etc.).

Ensure that the value entered here exactly matches the path configured in your server’s reverse proxy setup.

Refer to the relevant server guide for configuration examples:

- [Nginx server – Subfolder hosting](/help/docs/nginx-server)
- [ASP.NET Core server](/help/docs/aspnet-core-server)
- [Microsoft – IIS server](/help/docs/microsoft-iis-server)
- [Apache HTTP server](/help/docs/apache-http-server)

> [!WARNING]
> ** CAUTION
> 
> For **KB site 2.0** projects, subfolder hosting will work only when both the **Subfolder path** as well as the **Site API path** have been defined.

1. Navigate to **Settings** (**) > **Knowledge base site** in the left navigation bar in the **Knowledge base portal**.
2. In the left navigation pane, navigate to **Custom domain**.
3. On the **Custom domain** page, navigate to the **Subfolder hosting** tab.

By default, the **Site API path** is set to **/api**.
4. Clear the **Site API path** field and enter your custom site API path (**For example,** `/docs-api`).
5. Click the **Update** button on the right.

This new custom site API path will only work if the subfolder hosting setting is enabled in your project.

> [!NOTE]
> ** NOTE
> 
> The Custom **Site API path** is not the path for **API Documentation**.

![Custom domain mapping settings for subfolder hosting and API path configuration.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/site%20API%20path.png)

---

## Web servers

Here are some of the commonly used web servers

- **Apache HTTP server**
- **Nginx server**
- **ASP.NET Core server**
- **Microsoft - IIS server**
- **OpenResty server**
- **LiteSpeed server**
- **Cloudflare server**

> [!NOTE]
> ** NOTE
> 
> **What is a web server?** A web server stores and delivers the content for a website – such as text, images, video, and application data – to clients that request it. The most common type of client is a web browser program.

## Mandatory API path setup for KB site 2.0

If you are using KB 2.0 and hosting your knowledge base in a subfolder, it is mandatory to add a reverse proxy configuration for your Site API path (for example, `/api`) in your server settings.

Without this configuration, you may encounter redirect errors or broken API behavior.

Visit the relevant server article for setup instructions:

- [Nginx server – Subfolder hosting](/help/docs/nginx-server)
- [ASP.NET Core server](/help/docs/aspnet-core-server)
- [Microsoft – IIS server](/help/docs/microsoft-iis-server)
- [Apache HTTP server](/help/docs/apache-http-server)

---

## What happens next?

Once the web server is successfully configured, your knowledge base site will be live on your custom subfolder/subdirectory. However, the existing URL for your project will serve the requests. For example**,** `example.document360.io` and `example.com/docs` (if `/docs` is your folder path) will point to the Knowledge base site.

This will cause duplicate content in Search engines (Google, Bing, etc.). To do this, you will need to enable a URL redirect.

> [!NOTE]
> ** NOTE
> 
> To prevent duplicate content, enable the **Restrict subdomain access** toggle under **Settings > Knowledge base site > Custom domain > Subfolder hosting**. Ensure a canonical domain is configured before enabling this. Once enabled, your Document360 subdomain will automatically redirect to your canonical domain.

---

## Troubleshooting

### URL still shows '/docs' despite subfolder hosting being disabled

By default, the documentation is hosted under the `/docs` subfolder, and this path remains visible in the URL regardless of whether the subfolder hosting setting is activated or deactivated.

**Steps to resolve:**

To change the path,

1. Create a new subfolder in your project.
2. Enable the subfolder hosting setting for the newly created subfolder.
3. Complete the required configuration to apply the custom URL path.

![Custom domain mapping settings for subfolder hosting and API path configuration.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/subfolder%20path.png)

### 404 error due to duplicated '/docs' in canonical URL

When your site is hosted under a `/docs` subfolder, adding `/docs` in the canonical URL causes it to appear twice in the final URL (e.g., article-name/docs/docs/), leading to a 404 error.

**Steps to resolve:**

1. To fix the issue, update the canonical URL to include only the domain without the `/docs` path. For example, set the canonical URL as: `https://yourdomain.com/article-name`
2. This ensures that the `/docs` subfolder is added only once, maintaining the correct URL structure and preventing 404 errors.

![Settings for custom domain mapping, including subfolder hosting and canonical domain options.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/canonical%20domain(1).png)

---

### FAQ

#### What is a Canonical URL?

A canonical URL is the official link that tells search engines which version of a page to index and display in search results when there are multiple URLs for the same content. This helps prevent duplicate content issues and ensures the preferred URL is ranked properly in search results.

For example:

If your page is accessible through multiple URLs, such as:

- `https://example.com/page`
- `https://www.example.com/page`
- `https://example.com/page?utm=123`

You can set one of them (e.g., `https://www.example.com/page`) as the canonical URL to signal search engines to prioritize it.

#### How can I configure the canonical URL in Document360?

You can use the Canonical domain setting to globally replace the project subdomain with your specified domain for canonical URLs in all articles. This is particularly useful if you want to signal to search engines to index your custom domain (e.g., `www.yourdomain.com`) instead of the Document360 domain.

To change the canonical URL globally, follow the steps below:

1. Navigate to **Settings** (**) > **Knowledge base site** > **Custom domain** > **Subfolder hosting** in the Knowledge base portal.
2. On the **Subfolder hosting******tab, locate the **Canonical domain** option.
3. Enter your desired domain (e.g., `https://www.yourdomain.com`).
4. Click **Save******to save your changes.

## Related

- [Nginx server - Subfolder hosting](/nginx-server.md)
