Redirects & 404 Monitor
RedirectEngine attaches to ProcessPageView::pageNotFound so valid ProcessWire pages pay zero redirect lookup cost. Only requests that would otherwise return 404 Not Found are evaluated against seo-redirects and logged to seo-404s.
Managing Redirect Rules (seo-redirects)
Section titled “Managing Redirect Rules (seo-redirects)”Open Setup -> SEO -> Redirects to create, filter, import, and export redirect rules.
Match Types & Status Codes
Section titled “Match Types & Status Codes”| Match Type | Example source_path |
Example target_url |
Behavior |
|---|---|---|---|
exact |
/old-fleet/ |
/fleet/ |
Matches normalized path exactly (trailing-slash normalized, query strings preserved). |
wildcard |
/yachts-2025/* |
/fleet/$1 |
* captures path segments into $1, $2, etc. |
regex |
^/charter/([0-9]{4})/([a-z-]+)$ |
/fleet/$2/?year=$1 |
Evaluated safely with regex syntax validation (isValidRegex()) and pattern cap (MAX_PATTERN_RULES = 500). |
Supported HTTP status codes:
301(Permanent) and308(Permanent Strict, preserves HTTP method).302(Temporary) and307(Temporary Strict).410(Gone, informs crawlers a URL such as/brochures/2024-rates.pdfwas permanently removed; no destination URL required).
Automatic 301s on Page Slug Changes
Section titled “Automatic 301s on Page Slug Changes”When Auto-Create 301 on Slug / URL Change (redirects_auto_create) is enabled in Settings, renaming or moving a published ProcessWire page automatically creates a 301 redirect (is_auto = 1) from its previous path to its new URL, while collapsing redirect chains up to MAX_CHAIN_HOPS = 5 hops.
Bulk CSV / TXT Import
Section titled “Bulk CSV / TXT Import”Click Import CSV in Setup -> SEO -> Redirects (or run php vendor/bin/wire seo:redirect --import=...) using a UTF-8 CSV file up to 5 MB (MAX_IMPORT_BYTES = 5242880) and 5,000 rows (MAX_IMPORT_ROWS = 5000). See site/modules/Seo/examples/real-world/redirects.csv:
source_path,target_url,status_code,match_type,notes/old-fleet/,/fleet/,301,exact,Legacy fleet index migrated to /fleet//yachts-2025/*,/fleet/$1,301,wildcard,2025 seasonal yacht URLs redirected to canonical fleet slugs/summer-promo/,/gocek-12-islands-route/,302,exact,Temporary early-booking campaign landing redirect/brochures/2024-rates.pdf,,410,exact,Retired 2024 charter rate sheet permanently removed404 Monitor (seo-404s) & Buffered Telemetry
Section titled “404 Monitor (seo-404s) & Buffered Telemetry”Open Setup -> SEO -> 404 Monitor to inspect unhandled broken URLs sorted by hit frequency, filter by Unresolved, Resolved, or Frequent (5+ Hits), and convert any broken path into an active redirect with one click.
To protect database write throughput during crawler bursts:
- Static Asset Filtering: 15 static extensions (
IGNORED_404_EXTENSIONS, such as.ico,.map,.css,.js,.png,.woff2) are ignored automatically. - Buffered Writes (
RedirectTelemetryBuffer): Deduplicates repeated 404 paths within a 60-second window (DEDUP_404_TTL = 60), buffers hit increments inWireCache(HIT_FLUSH_INTERVAL = 60), and flushes atomically viaEntries::atomicIncrementBatch(). - Rate Limiting & Pruning: Respects
monitor_404_rate_limit(default60new entries/min) and automatically prunes oldest logs beyondmonitor_max_404_logs(default5000).
Managing Redirects via CLI
Section titled “Managing Redirects via CLI”# List active redirectsphp vendor/bin/wire seo:redirect
# Create or update a wildcard 301 rule (dry-run first)php vendor/bin/wire seo:redirect --from="/yachts-2025/*" --to="/fleet/$1" --code=301 --match=wildcard --dry-run --json
# Promote a 404 Monitor entry UUID to a 301 redirectphp vendor/bin/wire seo:redirect --promote-404=<404-uuid> --to="/destinations/gocek/" --code=301 --json
# Import a CSV filephp vendor/bin/wire seo:redirect --import=site/modules/Seo/examples/real-world/redirects.csv --json