Skip to content

How Prepend Path Works

Prepend Path allows you to automatically add a path prefix to every request before it is forwarded to your upstream.

This is useful when multiple websites or applications share the same upstream but are served from different routes. Instead of creating separate upstreams, each custom domain can forward requests to a different path within the same application.

For example, a request to:

customer.com/about

can be forwarded to:

app.example.com/customers/acme/about

The visitor continues browsing customer.com, while your upstream receives the request with the additional path.


By default, Hostgrid forwards requests to the upstream without changing the request path.

customer.com/about
app.example.com/about

When a Prepend Path is configured, Hostgrid inserts the configured prefix before forwarding the request.

For example:

  • Upstream: app.example.com
  • Custom Domain: customer.com
  • Prepend Path: /customers/acme

A request to:

https://customer.com/about

is forwarded to:

https://app.example.com/customers/acme/about

The browser URL remains unchanged. Only the request sent to your upstream is modified.


Prepend Path is applied as part of Hostgrid’s normal request routing.

Incoming Request
customer.com/about
Hostgrid
Prepend "/customers/acme"
app.example.com/customers/acme/about

The request is then forwarded to your upstream, which processes it normally.


When creating or editing a custom domain, you’ll find the Prepend Path field in the domain configuration, under Advanced Settings.

Prepend Path Field

Enter the path you want Hostgrid to prepend to every request.

Examples:

/dashboard
/sites/client1
/customers/acme
/v2

The path should begin with /.

Once the domain has been verified and activated, Hostgrid automatically applies the configured path prefix to every incoming request.


Many SaaS applications organize customer data under unique paths.

Example:

Upstream
app.example.com
customer-a.com
Prepend Path: /sites/customer-a
customer-b.com
Prepend Path: /sites/customer-b

Requests become:

customer-a.com/products
→ app.example.com/sites/customer-a/products
customer-b.com/products
→ app.example.com/sites/customer-b/products

This allows multiple customer domains to share the same application while serving different content.


Website builders often store customer websites under separate directories.

Example:

app.builder.com/sites/client1
app.builder.com/sites/client2
app.builder.com/sites/client3

Each custom domain can automatically route to the appropriate directory without requiring multiple upstreams.


Bubble applications frequently host multiple projects, client portals, or landing pages within a single application.

Using Prepend Path allows each custom domain to route to a different section of the same Bubble application.

Examples include:

  • Client-specific portals
  • Marketing microsites
  • White-labeled applications
  • Separate customer dashboards

Prepend Path can also separate different versions of an application.

Example:

staging.company.com
Prepend Path: /v2

A request to:

staging.company.com/login

is forwarded to:

app.example.com/v2/login

This allows production and staging environments to share the same upstream.


Upstream
app.example.com
┌──────────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
customer-a.com customer-b.com staging.company.com
│ │ │
▼ ▼ ▼
/sites/a /sites/b /v2
│ │ │
└──────────────────┴──────────────────┘
Forwarded to upstream

Each domain points to the same upstream while using a different path prefix.


  • Use descriptive and consistent path prefixes.
  • Match your path structure to your application’s routing.
  • Avoid changing path prefixes after a domain is live unless your upstream has also been updated.
  • Verify that your upstream serves content from the configured path.
  • Keep customer or application directories organized using predictable naming conventions.

  • Prepend Path modifies the request sent to your upstream.
  • It does not change the URL shown in the visitor’s browser.
  • Every custom domain can have its own Prepend Path.
  • Multiple domains can point to the same upstream while using different path prefixes.
  • Hostgrid does not modify your upstream application or its content—it only forwards requests to the configured path.