How to Host Your Knowledge Base on a Subdirectory
Hosting your Knowledge Base on a subdirectory (e.g., /docs/ or /help/) allows seamless integration of your help center into your main website. Instead of using a separate subdomain, you can access the knowledge base through a subfolder within your domain (e.g., https://www.example.com/docs/).
This article will guide you through the application and Apache server-side configuration required to host your Knowledge Base on a subdirectory.
Benefits of Hosting on a Subdirectory:
-
Brand Consistency: Keep your knowledge base within your primary domain to maintain a consistent brand identity.
-
SEO Advantages: Boost your website’s search engine rankings by consolidating all content under one domain.
-
Enhance User Experience: Users can navigate seamlessly between your website and the knowledge base without switching domains.
Step 1: Configure Your Knowledge Base
- Navigate to Settings -> Configure -> Enabling Subdomain Hosting.
- Enter the desired Subfolder name (e.g., docs or help).
- Enter your domain name without http:// or https:// (e.g., www.example.com.)
Make sure to press the ‘Save’ button to apply your changes.
Step 2: Configure Apache Server
After configuring the application settings, you must update your Apache server to route traffic from the subdirectory to your knowledge base.
1. Enable Required Apache Modules
Run the following commands to enable the necessary modules for proxying requests and handling headers:
2. Update Virtual Host Configuration
Modify your Apache virtual host file to route traffic from the /docs/ subdirectory to your knowledge base.
Example configuration:
3. Apply the Changes
Once the configuration is updated, restart the Apache server to apply the changes:
Important Notes
-
This setup redirects your subdirectory (e.g., /docs/) to the Knowledge Base URL.
-
Private sites are not supported in this setup.
-
Language-specific (e.g., /fr/, /es/) and versioned sites are incompatible.
-
Ensure your domain has SSL (HTTPS) enabled for security.
-
Some advanced features (SEO settings, private access, etc.) will be limited in visitor mode.
- Custom domains are not applicable for this configuration.
Troubleshooting
1. The site is not loading correctly in the subdirectory.
-
Ensure that the subdirectory setup is correctly configured.
-
Verify that the ProxyPass and ProxyPassReverse settings in your Apache configuration file are correct.
-
Restart Apache after making any changes.
2. Some forms (e.g., feedback, contact) are not working.
-
Check that the Origin HTTP header is correctly set.
-
Ensure the following cookies are forwarded:
-
authorized_url_only_category_ids (for restricted categories)
-
authorized_kb_encrypted_url_only (if your knowledge base is encrypted)
-
That’s it! Your Knowledge Base is now successfully hosted on a subdirectory. Please contact our support team if you encounter any issues or questions.