Hosting Document360 on a sub-directory
  • 17 Feb 2021
  • 1 Minute To Read
  • Contributors
  • Print
  • Share
  • Dark

Hosting Document360 on a sub-directory

  • Print
  • Share
  • Dark

Many companies host their documentation under a subdirectory on their website domain, for example: This is because hosting your knowledge base on a subdirectory of a website, rather than subdomain ( is better for SEO.

This article will use the following platforms to show you how you can host Document360 on a sub-directory:

  • Apache
  • Nginx
  • ASP.NET Core
  • IIS Server

To host Document360 on a sub-directory


The following examples assume:

  • That you want to setup your documentation at
  • That you have working knowledge of the terminal
  • That your documentation on Document360 is hosted at

To set up an Apache server sub-directory

  1. Ensure the following modules are installed and enabled:
    sudo a2enmod proxy
    sudo a2enmod proxy_balancer
    sudo a2enmod proxy_http
  2. Add the following to the site configuration file under /etc/apache2/sites-available For example: 000-default.conf
SSLProxyEngine on
ProxyPass "/docs"  “”
ProxyPassReverse "/docs"  “”
  1. Restart the Apache server
sudo systemctl restart apache2

To set up a Nginx server sub-directory

  1. Add the following location section in your Nginx configuration file (/etc/nginx/default).
location /docs {
                proxy_set_header        Host;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Forwarded-Proto $scheme;
                proxy_set_header        "requested-by" "proxy";
  1. Restart the server.

To set up an ASP.Net Core sub-directory

  1. Install the ASP.Net Core package
  2. In the Startup.cs file, configure the method as follows:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
            /// ...

            app.MapWhen(ctx => ctx.Request.Path.StartsWithSegments("/docs"),
                builder => builder.RunProxy(new ProxyOptions() {
                    Scheme = "https",
           /// ...

To set up an IIS Server sub-directory

  1. Install the URL Rewrite module for IIS Server

  2. Install the Application Request Routing module, and ensure its enabled

  3. Add the following rewrite rule in web.config to rewrite contents from your documentation at /docs

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="rewrite">
                    <match url="^docs(/.*)?" />
                    <action type="Rewrite" url="{R:1}" />

Next Step

Your documentation is live on your sub-folder now. But still the existing url for your project will serve the requests. For example - and (if /docs is your folder path) both will serve the documents.

It will cause duplicate content in Search Engines. To enable the redirect from* to* - please contact us at

Was This Article Helpful?