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.
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.