Skip to content
Back to Docs Redirect rules Smart redirect

Redirect rules: smart routing by conditions

Route traffic by device/country/time and use a fallback URL when no rule matches — improve UX and conversions.

Tip: Always test priority order to avoid wrong matches or loops.

Concept

Each link can have multiple rules. The system evaluates rules by priority order and applies the first match. If nothing matches, it uses the fallback URL.

  • Rule = (conditions) + (destination URL).
  • Higher priority rules run first.
  • Put narrow/specific rules before broad ones.

Common conditions

You can route traffic by multiple criteria. Depending on the system, you can enable/disable these condition groups:

Device

Redirect based on device (mobile/desktop/tablet) to deliver the best landing experience.

  • Mobile → fast mobile-optimized landing.
  • Desktop → richer content landing.
Geo (Country)

Route by country to match language/offer.

  • VN → Vietnamese landing / local offer.
  • US → English landing / US offer.
Time

Route by time windows for promos or campaign testing.

  • Peak hours → offer A.
  • Off-hours → offer B.

Priority

Priority prevents broad rules from overriding specific ones. Always define a clear order.

  • Narrow targeting (US + Mobile) first.
  • Broader rules (Mobile) after.
  • “Any/All” rules last (before fallback).

Fallback URL

Fallback is used when no rule matches. It ensures the link always works.

  • Use a stable default landing as fallback.
  • Do not point fallback back to the same link (loop risk).
  • Preserve UTM if needed (system-dependent).

301 vs 302

Choose the right redirect code for your goal:

302 (Temporary) — recommended for ads/testing

Use when you frequently change destinations, run A/B tests, or route dynamically.

  • More flexible, less “hard cache”.
  • Great for campaigns/ads.
301 (Permanent) — best for long-term destinations

Use when destination is stable and you want a “permanent” signal.

  • May cache longer.
  • Good for docs or permanent migrations.

Quick examples

Common rule patterns (illustrations):

Example 1: Geo + Device
Sample
Country = VN AND Device = Mobile https://example.com/vn-mobile
Country = VN https://example.com/vn
Device = Mobile https://example.com/mobile
Fallback https://example.com/default
Use the priority order as shown above.
Example 2: Time window (flash sale)
Sample
Time = 20:00–23:59 https://example.com/flash
Time = 00:00–19:59 https://example.com/normal
Fallback https://example.com/normal
Use the priority order as shown above.

Testing & debugging

Before going live, test rules carefully:

  • Test on mobile/desktop; use VPN for geo testing if needed.
  • Confirm 301/302 responses match configuration.
  • If loop happens: check fallback and ensure no rule points back to the same link.
  • If wrong match: check priority order and condition values.

FAQ

Usually 302 is better for ads because it’s flexible for destination changes and A/B tests.

A fallback is strongly recommended so links always work when no rule matches.

Don’t point rules/fallback back to the same link or to a URL that redirects back. Always test after saving.

Want smart redirects by rules?

Open the dashboard to create links and configure redirect rules per campaign.