Skip to main content
All CollectionsExtras
URL Redirects & Forwarding
URL Redirects & Forwarding

Learn how to set up URL redirects and forwarding for your domains. Easily redirect from old domains to new ones and handle domain migrations

Drago Crnjac avatar
Written by Drago Crnjac
Updated over 3 weeks ago

Redirects in SaaS Custom Domains let you forward traffic from one domain to another while maintaining full control over how the redirection happens. Whether you need to redirect an entire domain, specific paths, or complex URL patterns, our redirects feature has you covered.

Creating a Redirect

Once you're in the dashboard, click the New Redirect button. The redirect creation pop-up will appear:

The most important parts of a redirect are:

  • Source Host — the domain where the incoming request arrives (e.g., old-domain.com)

  • Destination URL — where you want to send the traffic (e.g., https://new-domain.com)

  • Match Path — which paths should be redirected (default is "*" which means all paths)

Advanced Options

Redirects come with several powerful customization options:

  • Redirect Type — choose between:

    • Permanent (301) — tells browsers and search engines that the redirect is permanent

    • Found (302) — indicates a temporary redirect

  • Preserve Path — when enabled, the original request path is appended to the destination URL

    • Example: if enabled, old-domain.com/blog redirects to new-domain.com/blog

    • If disabled, all requests go to exactly the destination URL you specified

  • Preserve Query String — when enabled, any query parameters in the original request are preserved

    • Example: if enabled, old-domain.com/search?q=test redirects to new-domain.com/search?q=test

    • If disabled, query parameters are dropped

Path Matching

The Match Path field supports powerful pattern matching:

  • Use "*" to match all paths (default)

  • Specify exact paths like "blog" or "products/t-shirts"

  • Add a trailing asterisk for prefix matching:

    • "blog/*" matches "blog/post-1", "blog/categories", etc.

  • Paths should not start or end with slashes

  • Only letters, numbers, dashes, underscores, and an optional trailing asterisk are allowed

DNS Setup

For redirects to work, you'll need to point your domain (source host) to SaaS Custom Domains. You have two options:

  1. CNAME Record (Recommended)

    • Add a CNAME record pointing to in.saascustomdomains.com

    • Example: If your source_host is blog.old-domain.com, create a CNAME record for blog.old-domain.com pointing to in.saascustomdomains.com

  2. A Records

    • Add two A records pointing to our IP addresses:

      • First A record: 75.2.96.173

      • Second A record: 99.83.186.151

💡 Pro tip: We recommend using the CNAME option as it's more resilient to infrastructure changes. However, if you're redirecting a root domain (e.g., example.com), you'll need to use A records since root domains cannot have CNAME records according to DNS standards.

Important Notes

  • Redirects take precedence over custom domains. If you create a redirect for a domain you're already using as a custom domain, and the request matches both the Source Host and Match Path, the redirect will be applied instead of forwarding to your upstream

    • Example: If you have a custom domain app.example.com pointing to your upstream, and create a redirect for app.example.com with Match Path *, all requests will be redirected according to your redirect rules instead of going to the upstream

  • Redirects can be temporarily disabled by toggling their "Active" status

💡 Pro tip: Use path matching and preserve options together for maximum flexibility.

For example:

  • Redirect all blog posts with blog/* as the match path and preserve_path enabled

  • Redirect specific paths to new URLs by disabling preserve_path

  • Maintain analytics tracking by preserving query strings

That's it! You now know everything about creating and managing URL redirects in SaaS Custom Domains.

Until next time, keep building!


Need more help? Reach out via the Intercom chat widget and we'll be right with you!

Did this answer your question?