Skip to content

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.

Open Setup -> SEO -> Redirects to create, filter, import, and export redirect rules.

Redirects tracks exact, wildcard, and regex rules with total hit counters, saved status views, CSV import, and Export All.
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) and 308 (Permanent Strict, preserves HTTP method).
  • 302 (Temporary) and 307 (Temporary Strict).
  • 410 (Gone, informs crawlers a URL such as /brochures/2024-rates.pdf was permanently removed; no destination URL required).

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.

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 removed

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

404 Monitor records broken URLs with hit counts and referrers so you can promote high-traffic 404s directly into 301 redirects.

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 in WireCache (HIT_FLUSH_INTERVAL = 60), and flushes atomically via Entries::atomicIncrementBatch().
  • Rate Limiting & Pruning: Respects monitor_404_rate_limit (default 60 new entries/min) and automatically prunes oldest logs beyond monitor_max_404_logs (default 5000).
Terminal window
# List active redirects
php 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 redirect
php vendor/bin/wire seo:redirect --promote-404=<404-uuid> --to="/destinations/gocek/" --code=301 --json
# Import a CSV file
php vendor/bin/wire seo:redirect --import=site/modules/Seo/examples/real-world/redirects.csv --json

Next steps