Overview
Prepend Path is a powerful feature that allows you to add a custom path prefix to requests forwarded from your custom domains to your upstream. This is especially useful when hosting multiple websites or applications under a single upstream server.
How Prepend Path Works
When you set a Prepend Path for a custom domain, all requests to that domain will automatically have the specified path prefix added before being forwarded to your upstream.
For example, if you configure:
Upstream:
app.upstream.com
Custom Domain:
app.company.com
Prepend Path:
/page/user1
Then a request to app.company.com/about
will be forwarded to app.upstream.com/page/user1/about
Creating a Custom Domain with Prepend Path
When creating a new custom domain, you'll find the Prepend Path option in the creation form:
Simply enter the path prefix you want to add to all requests. The path can only contain letters, numbers, dashes, and underscores.
Use Cases
Multi-tenant Applications
Perfect for platforms where multiple users or organizations share the same application infrastructure:
Website builders hosting different client sites
E-commerce platforms with multiple storefronts
Educational platforms with separate school portals
Bubble.io Applications
Ideal for Bubble.io users managing multiple applications:
Multiple client projects under one Bubble.io account
Separate landing pages and microsites
Different versions of your app (staging, production)
Development and Staging Environments
Easily manage different versions of your application:
Route staging.company.com/v1 to your v1 codebase
Route staging.company.com/v2 to your v2 codebase
Maintain separate paths for testing and production
Example Scenarios
Website Builder Platform
Upstream: app.builder.com
Custom Domain: client1.builder.com
Prepend Path: /sites/client1
Result: client1.builder.com/shop β app.builder.com/sites/client1/shop
Custom Domain: client2.com
Prepend Path: /sites/client2
Result: client2.com/blog β app.builder.com/sites/client2/blog
Educational Platform
Upstream: app.eduplatform.com
Custom Domain: school1.eduplatform.com
Prepend Path: /schools/primary
Result: school1.eduplatform.com/classes β app.eduplatform.com/schools/primary/classes
Custom Domain: school2.com
Prepend Path: /schools/secondary
Result: school2.com/classes β app.eduplatform.com/schools/secondary/classes
Best Practices
Use consistent naming conventions for your path prefixes
Document your path structure for easier maintenance
Consider using descriptive paths that reflect your application's organization
Avoid special characters that might need URL encoding
Until next time, keep building!
Need more help? Reach out via the Intercom chat widget and we'll be right with you!