Agent-readable docs index: /docs/llms.txt. Full docs in one file: /docs/llms-full.txt. Download /docs/docs.zip to grep all markdown files locally.

Setting Custom Root & 404 Fallback Redirects

When maintaining a custom branded domain like link.yourbrand.com, two scenarios always occur outside of normal short link resolution:
Root Access
A visitor navigates directly to https://link.yourbrand.com/ with no slug. Without a configured root redirect, they land on a blank or error page.
Missing Slug (404)
A visitor follows a deleted, mistyped, or expired link like https://link.yourbrand.com/non-existent. Dead-end 404 pages damage user trust.
This guide explains how to configure dedicated redirect rules for both scenarios so every visitor lands somewhere useful.

Configuring Redirects in the Console

    Open Domain Settings

    Navigate to dash.shaf.app → Domains. Click on the domain you want to configure.

    Locate the Domain Routing Configuration Card

    Scroll to the Domain Routing Configuration section within the domain detail page.

    Set the Root Redirect URL

    SettingDescription
    Root Redirect URLWhere visitors land when accessing https://your.domain/ with no path
    Default (blank)Redirects to the Shaf marketing site
    RecommendedYour main marketing landing page or product homepage
    Example:
    https://yourbrand.com

    Set the 404 Not Found Redirect URL

    SettingDescription
    404 Redirect URLWhere visitors land when the slug doesn't match any link
    Default (blank)Displays a generic error page
    RecommendedYour product search page, support center, or help docs
    Example:
    https://yourbrand.com/help

    Save Domain Settings

    Click Save Domain Settings. Changes are propagated globally to Cloudflare edge nodes within seconds.

Verifying via cURL

Test the root redirect:
curl -I https://link.yourbrand.com/
Expected output:
HTTP/2 302 location: https://yourbrand.com
Test a non-existent slug:
curl -I https://link.yourbrand.com/slug-that-does-not-exist
Expected output:
HTTP/2 302 location: https://yourbrand.com/help

Redirect Strategy Recommendations

For Marketing Sites
Root → Homepage (yourbrand.com) 404 → Campaign hub or content archive (yourbrand.com/campaigns)
Keeps users in your funnel when they arrive at your short link domain directly.
For Developer Tools
Root → API documentation or status page 404 → Support documentation (docs.yourbrand.com)
Ensures developers who follow stale links or test URLs land on useful content.
For E-Commerce
Root → Product catalog or homepage 404 → Site search (yourbrand.com/search) or bestsellers
Recovers potentially lost sales from broken or expired promotion links.

Troubleshooting

My browser redirects to an old cached page instead of the new fallback
Test with curl -I to bypass browser redirect caching. If curl shows the correct location header, the issue is your browser caching the old behavior. Open an Incognito/Private window to test without cache.
The 404 redirect is not triggering for non-existent slugs
Verify the 404 Redirect URL field is not empty in your domain settings and that you clicked Save Domain Settings after editing. Also confirm the destination URL is reachable by visiting it directly in your browser.
How do I configure custom fallbacks for expired links instead of 404s?
For expired links specifically, you can configure a per-link fallback URL in the Link Expiration settings (separate from the domain-level 404 redirect). See Password Protection & Link Expiration for details.