Conditional Redirects

Redirect visitors based on specific conditions including browser language, URL parameters, referrer source, and login status. Create personalized user experiences and improve targeting with intelligent routing.

Use Cases

  • Language-Based Redirects: Send Spanish-speaking visitors to your Spanish site
  • Campaign Tracking: Route visitors from specific UTM campaigns to dedicated landing pages
  • Referrer-Based Routing: Welcome visitors from partner sites or social media
  • Login-Based Access: Show different content to logged-in vs. logged-out users

How It Works

  1. Navigate to Switchboard → Conditional Redirects
  2. Create redirect rules with specific conditions
  3. Rules are evaluated in priority order
  4. The first matching rule triggers the redirect

Conditional Redirects only affect frontend pages. WordPress admin, login page, AJAX requests, and REST API are never redirected.

Creating a Redirect Rule

Each rule consists of:

  1. Rule Name: A descriptive name for your reference
  2. Priority: Lower numbers are checked first (default: 10)
  3. Conditions: One or more criteria that must match
  4. Source Page: Optional - limit to specific URLs
  5. Redirect Target: Where to send matching visitors
  6. Redirect Type: 301 (permanent) or 302 (temporary)

Condition Types

Browser Language

Redirect based on the visitor’s browser language setting.

FieldDescription
LanguagesComma-separated language codes (e.g., es, fr, de)

The module checks the browser’s Accept-Language header and matches the first two characters (language code).

Example: es matches Spanish speakers (es-ES, es-MX, es-AR, etc.)

URL Parameter

Redirect when specific query parameters are present.

FieldDescription
Parameter NameThe URL parameter to check (e.g., utm_source)
Parameter ValueOptional - specific value to match

Examples:

  • Parameter: ref, Value: (empty) → Matches any URL with ?ref=anything
  • Parameter: utm_source, Value: facebook → Matches only ?utm_source=facebook

Referrer

Redirect based on where the visitor came from.

FieldDescription
Referrer PatternText to match in the referrer URL

Examples:

  • facebook.com → Visitors coming from Facebook
  • google.com → Visitors coming from Google search
  • partner-site.com → Visitors from a specific partner

Login Status

Redirect based on whether the visitor is logged in.

FieldDescription
Status“Logged In” or “Logged Out”

Use cases:

  • Redirect logged-out users from /dashboard/ to /login/
  • Redirect logged-in users from /login/ to /dashboard/

Condition Logic

When multiple conditions are enabled on a single rule:

  • All conditions must match for the redirect to trigger
  • Conditions are evaluated in the order: Language → URL Parameter → Referrer → Login Status

Example: A rule with Language = es AND Referrer = facebook.com only redirects Spanish-speaking visitors who came from Facebook.

Source Page Options

Limit which pages the rule applies to:

SettingBehavior
Empty (default)Rule applies to all frontend pages
/Only homepage
/pricing/Only the pricing page
/blog/*All pages starting with /blog/

Use wildcards (*) for pattern matching. /products/* matches /products/shoes/, /products/hats/, etc.

Redirect Actions

Fixed URL

Redirect to a specific URL (internal or external).

Examples:

  • /es/ → Internal page
  • https://spanish-site.com → External site

Append to Path

Add a segment to the current URL path.

Example: Append value /es/ turns /about/ into /es/about/

Useful for language-based folder structures.

Add Parameter

Add a query parameter to the current URL.

Example: Parameter lang=es turns /about/ into /about/?lang=es

Useful for systems that use URL parameters for language detection.

Redirect Types

TypeWhen to Use
301 (Permanent)Content has permanently moved; SEO passes link juice
302 (Temporary)Temporary conditions; doesn’t affect SEO rankings

Use 302 for conditional redirects that may change (like A/B tests or temporary campaigns). 301s are cached by browsers and search engines.

Tracking and Statistics

Each redirect rule tracks:

  • Hit Count: Number of times the redirect has triggered
  • Active Status: Whether the rule is currently enabled

View statistics in the Conditional Redirects dashboard.

Priority System

Rules are evaluated in priority order (lowest number first):

  1. Rule with Priority 1 is checked first
  2. If it matches, redirect happens immediately
  3. If not, Priority 2 is checked, and so on

Example priorities:

  • 5: High priority - campaign-specific redirects
  • 10: Default - general redirects
  • 20: Lower priority - fallback redirects

Loop Prevention

The module automatically prevents redirect loops by:

  • Comparing the current URL with the target URL
  • Skipping redirects if they would create a loop
  • Normalizing URLs for accurate comparison

Performance

  • Rules are cached for 5 minutes to reduce database queries
  • Only active rules are loaded
  • Frontend-only execution (no admin overhead)

FAQ

Why isn’t my redirect working?

Check these common issues:

  1. Is the rule active? (Toggle must be on)
  2. Are all conditions being met? (All enabled conditions must match)
  3. Is the source URL correct? (Test with empty source first)
  4. Is there a redirect loop? (Target URL equals current URL)
  5. Are you testing on frontend? (Admin pages are never redirected)
Can I redirect logged-in admins?Yes, but be careful. Test thoroughly with a non-admin account first. You could lock yourself out of your site if you create a redirect that affects admin pages (though the module protects wp-admin by default).
How does this differ from Redirects Manager?Redirects Manager handles simple URL-to-URL redirects (like fixing broken links). Conditional Redirects adds logic-based routing (if visitor meets conditions X, Y, Z, then redirect).
Does this affect SEO?Conditional redirects using 302 (temporary) don’t pass SEO value. Use 301 only for permanent redirects where you want search engines to update their index.
PRO

Get access to all 147 modules with a single license

Upgrade to Pro