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.

Apache HTTP server

Prev Next

Hosting your Document360 knowledge base in a subfolder on Apache, such as example.com/docs, requires enabling Apache modules and configuring proxy and redirect rules. This article covers enabling the required modules, routing the home page, article and category pages, and the Site API path, generating sitemaps, and handling URL redirection to avoid duplicate content in search engines.

NOTE

Replace the example domain throughout this article with your own Document360-provided domain or custom domain. For example, example.document360.io represents your domain, example.document360.io/v1 represents a workspace subfolder path, and example.document360.io/help represents a subfolder home page path.


Before you begin

Subfolder hosting works only when both the Subfolder path (for example, /docs or /help) and the Site API path (for example, /api) are defined in Document360, with matching configuration on your server.

Ensure the following Apache modules are enabled — these are part of the standard Apache installation:

  • proxy
  • proxy_http
  • headers
  • substitute
  • proxy_html

Enable them with:

sudo a2enmod proxy proxy_http headers substitute proxy_html

How to configure the home page

Configure the following Virtual Host location block to proxy requests for the home page, where the path starts with /help:

<Location /help>
   ProxyPreserveHost off
   RequestHeader set Host example.document360.io
   RequestHeader set requested-by proxy
   RequestHeader unset Accept-Encoding
   ProxyPass https://example.document360.io/v1
   ProxyPassReverse https://example.document360.io/v1

   AddOutputFilterByType SUBSTITUTE text/html
   substitute 's|href="/docs|href="/help|ni'
   substitute 's|href="/v1/docs|href="/help|ni'
   substitute 's|href="https://example.document360.io/docs|href="https://docs.example.com/help|ni'
</Location>

Fixing article preview links for subfolder hosting

Article preview links in the Document360 portal include the workspace and language slug in the URL. For example, the live article URL might be docs.example.com/getting-started, while the portal preview link is docs.example.com/v1/en/getting-started. You can either add a location block to handle the /v1/en path, or set a redirect from /v1/en to /:

RewriteEngine on
RewriteRule ^v1/en$ / [R=301,L,NC]

This redirect requires the rewrite module:

sudo a2enmod rewrite

How to configure article and category pages

Add the following location blocks to the same Apache Virtual Host configuration file to proxy article, category, and API requests:

<Location /help/>
   ProxyPreserveHost off
   RequestHeader set Host example.document360.io
   RequestHeader set requested-by proxy
   ProxyPass https://example.document360.io/docs/
   ProxyPassReverse https://example.document360.io/docs/

   AddOutputFilterByType SUBSTITUTE text/html
   substitute 's|href="/docs|href="/help|ni'
   substitute 's|href="/v1/docs|href="/help|ni'
   substitute 's|href="https://example.document360.io/docs|href="https://docs.example.com/help|ni'
</Location>

<Location /api>
  ProxyPreserveHost off
  RequestHeader set Host example.document360.io
  RequestHeader set requested-by proxy
  RequestHeader unset Accept-Encoding
  ProxyPass https://example.document360.io/api
  ProxyPassReverse https://example.document360.io/api

  AddOutputFilterByType SUBSTITUTE application/json
  substitute 's|href="/docs/|href="/help/|ni'
  substitute 's|href="/v1/docs/|href="/help/|ni'
  substitute 's|href="https://example.document360.io/docs/|href="https://docs.example.com/help/|ni'
</Location>

Restart the Apache server once configured:

sudo systemctl restart apache2

NOTE

Replace /docs and /api with the exact values configured under Subfolder path and Site API path in the Document360 portal.


How to set up sitemap generation

The sitemap prefix stays the same except for the language code (en, fr, de, and so on).

<Location /sitemap.xml.en>
    RequestHeader set Host example.document360.io
    RequestHeader set requested-by proxy
    ProxyPass https://example.document360.io/sitemap.xml.en
    ProxyPassReverse https://example.document360.io/sitemap.xml.en
</Location>

What happens next

Once Apache is configured, your knowledge base site is live on your custom subfolder. The existing Document360 URL continues to serve requests as well — for example, both example.document360.io and example.com/docs will point to your knowledge base site. This causes duplicate content in search engines like Google and Bing.

To prevent duplicate content, enable the Restrict subdomain access toggle under Settings > Knowledge base site > Custom domain > Subfolder hosting. Make sure a canonical domain is configured before enabling this — once enabled, your Document360 subdomain automatically redirects to your canonical domain.


Best practices

  • Enable all five required Apache modules (proxy, proxy_http, headers, substitute, proxy_html) before configuring location blocks, or proxying and rewriting won't work.
  • Keep the Subfolder path and Site API path identical between the Document360 portal and your Apache configuration to avoid broken routing.
  • Use the substitute rules consistently across the home page, article/category, and API location blocks to avoid mixed /docs and /help links on the live site.
  • Set up the /v1/en redirect for article preview links early, since mismatched preview links can otherwise cause confusion for content authors.