How to Run Your Knowledge Base on a Subdirectory (e.g. /help)
Learn how to configure your server to load Helpjuice from a subdirectory
Table of Contents
Set Up Your Server Apache Setup Example NGINX Setup Example Troubleshooting & Authentication Tips Updating Your Knowledge Base Templates Best PracticesHosting your Knowledge Base under a subdirectory (for example, https://yourdomain.com/help
) instead of a separate subdomain can improve SEO and create a more unified experience for your users. It ensures your help center feels like a natural part of your site.
In this article, you’ll learn:
- How to configure Apache or NGINX to serve Helpjuice from a subdirectory
- Common troubleshooting & authentication tips
- What template updates are needed after switching to a subdirectory setup
Set Up Your Server
If you’re using Apache or NGINX, you can configure your server to load your Knowledge Base from a subdirectory.
Before getting started, make sure you:
- Use Apache or NGINX as your web server
- Have access to your server configuration files
- Can restart your server after applying changes
Once you're ready, follow these steps:
- Identify whether your server uses Apache or NGINX.
- Copy the appropriate configuration code from the examples below.
- Replace the highlighted values with your actual domain and preferred subdirectory.
- Paste the configuration into your server’s configuration file.
- Restart your server to apply the changes.
- Update your Knowledge Base templates.
Apache Setup Example
If you're using Apache, first enable the required modules:
sudo a2enmod proxy
sudo a2enmod proxy_http
Then restart Apache and add the following configuration to your virtual host or site config:
ProxyPass "/help" "https://yourAccount.helpjuice.com/"
ProxyPassReverse "/help" "https://yourAccount.helpjuice.com/"
NGINX Setup Example
If you're using NGINX, add the following configuration inside your server
block:
server {
listen 80;
large_client_header_buffers 4 16k;
server_name yourwebsite.com;
location ~ ^/help/?((?<=/).*)?$ {
proxy_set_header Host yourAccount.helpjuice.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For yourAccount.helpjuice.com;
proxy_pass https://yourAccount.helpjuice.com/$1$is_args$args;
proxy_read_timeout 90;
proxy_http_version 1.1;
}
}
Troubleshooting & Authentication Tips
If your setup isn’t working as expected, here are a few common issues to double-check:
-
HTTP Headers: If you're rewriting requests through a proxy, make sure the
Origin HTTP
header is set to your Helpjuice subdomain - e.g.,https://yourAccount.helpjuice.com
. -
Cookies: Some features require cookies to be passed correctly from Helpjuice to your end users. Ensure your server allows these cookies to be forwarded:
- _helpjuice_session_v2
- authorized_url_only_category_ids
- authorized_kb_encrypted_url_only
- authorized_url_only_question_id
- current_user_language
- segment_fields
-
Cookie Domains (Authentication): If your site runs on a different domain than
*.helpjuice.com
, you may need to rewrite the cookie domain in your proxy config. Refer to your server documentation for details:
Updating Your Knowledge Base Templates
After setting up your Knowledge Base to run on a subdirectory (like /help
), some updates will be required in your templates to ensure everything functions correctly.
This includes changes to internal links, form actions, meta tags, and any custom scripts that reference URLs or paths.
For a complete list of what needs to be updated - along with examples and implementation tips - refer to the following guide: Template Changes for Subdirectory Setup.
Best Practices
- Test in a staging environment before making changes live.
- Keep backups of your original template files in case you need to revert.
- Always double-check proxy configurations and cookie settings to avoid authentication issues.