Plans supporting hosting Document360 on a sub-directory
Professional | Business | Enterprise |
---|---|---|
What is subfolder hosting?
Subfolder hosting is a 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
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,
Navigate to Settings () in the left navigation bar in the Knowledge base portal.
In the left navigation pane, navigate to Knowledge base site > Custom domain > Subfolder hosting tab.
By default, the Subfolder path is set to /docs.
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.
Custom Subfolder paths
You can also set up your knowledge base on subfolder/subdirectory paths other than /docs
.
For example, /help
, /support
, etc.
Navigate to Settings () in the left navigation bar in the Knowledge base portal.
In the left navigation pane, navigate to Knowledge base site > Custom domain > Subfolder hosting tab.
By default, the Subfolder path is set to /docs.
Clear the Subfolder path field and enter your custom subfolder path (For example,
/help
).Click on 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
For projects configured with custom domain and subfolder hosting, the Article preview option is not supported yet.
Custom Site API paths
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.
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.
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.
Navigate to Settings () in the left navigation bar in the Knowledge base portal.
In the left navigation pane, navigate to Knowledge base site > Custom domain > Subfolder hosting tab.
By default, the Site API path is set to /api.
Clear the Site API path field and enter your custom site API path (For example,
/docs-api
).Click on 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
The Custom Site API path is not the path for API Documentation.
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
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.
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.). For this, you will need to enable a URL redirect.
NOTE
To enable the redirect from
example.document360.io
toexample.com/docs
, please contact us at support@document360.com.
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,
Create a new subfolder in your project.
Enable the subfolder hosting setting for the newly created subfolder.
Complete the required configuration to apply the custom URL path.
404 error due to duplicated '/docs' in canonical URL
When your site is hosted under a /docs
sub-folder, 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:
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
This ensures that the
/docs
sub-folder is added only once, maintaining the correct URL structure and preventing 404 errors.
FAQs
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:
Navigate to Settings () > Knowledge base site > Custom domain > Subfolder hosting tab in the Knowledge base portal.
Under Subfolder hosting tab, locate the Canonical domain option.
Enter your desired domain (e.g.,
https://www.yourdomain.com
).Click Save to save your changes.