← All 13 Plugins

Odos

Redirect Manager

Ὁδός (Hodós) — Path, way, road, route. In pre-Socratic Greek philosophy (such as Parmenides), Hodós represents the true course, the pathway of inquiry and arrival.

Category: Performance & Caching Version: 1.0.0 Requirements: PHP 7.4+ · WP 5.8+ Runtime: O(1) regex · 0ms .htaccess sync

Overview

Odos (Greek for path or road) provides a lightweight, native interface to manage 301/302 redirects, track 404 errors, and perform complex wildcard routing—all without bloated database queries. Its compiled regex engine ensures constant-time lookup overhead regardless of the number of rules.

Architectural Rationale: Traditional WordPress redirect plugins perform sequential O(N) database queries or regex evaluations on every incoming request, severely degrading Time To First Byte (TTFB). Odos compiles all wildcard rules into a single precompiled regular expression tree, collapsing routing overhead to O(1) constant time, and buffers 404 log writes in memory until the PHP shutdown hook.

Key Features

  • O(1) Regex Compilation

    Wildcard rules are pre-compiled into a single grouped regex, taking routing lookup from O(N) down to O(1) on every page load.

  • 0ms Server-Level Sync

    Optionally syncs redirect rules directly to Apache/LiteSpeed .htaccess, letting the web server handle redirects before PHP boots.

  • Zero-Latency 404 Logging

    404 errors are buffered in memory and written atomically during the PHP shutdown hook, eliminating DB latency from TTFB.

  • Static Asset Fast-Path

    Bypasses regex evaluation and database lookups for static assets (.css, .js, .webp, .jpg) to save server memory.

  • Smart Loop Prevention

    Actively analyzes destination paths and wildcard outputs to prevent infinite redirect loops.

  • Foolproof Normalization

    Automatically standardizes paths, respects subdirectories, and optimizes trailing slashes.

  • Post/Page Autocomplete

    Instant AJAX search for target pages, posts, and custom post types.

  • Smart CSV Importer

    Auto-detects delimiters and dynamically converts legacy regex into native Odos wildcards.

Technical Specifications

Complexity O(1) regex routing lookup overhead
Database wp_odos_redirects, wp_odos_logs (atomic shutdown writes)
Server Sync define('ODOS_SYNC_HTACCESS', true);
Architecture Strictly typed PHP 7.4+, PSR namespace structure
Query Preservation Full $_GET parameter preservation (e.g. UTM tracking parameters)

Developer Integration

// wp-config.php: Sync redirects directly to web server level
define('ODOS_SYNC_HTACCESS', true);

// Odos compiles all wildcard rules into a single lightning-fast regex:
// ~^(?:(?P<rule_1>/old-blog/(?P<wild_1>.*))|(?P<rule_2>/promo/(?P<wild_2>.*)))$~i
WP-CLI: $ wp odos compile-routes

Deployment Notes

Supports multi-parameter wildcards like /store/*/product/* to /shop/$1/$2. Bypasses execution entirely on recognized static assets.