Redirects

Custom URL redirects (301/302) in WordPress

Redirects maintains a simple rules table — source path, target path and redirect type. It also supports regular expressions with backreferences, so a single rule can redirect an entire renamed section of your site.

Key features

  • A simple rules table showing hit counts for each rule
  • Supports both 301 (permanent) and 302 (temporary) redirects
  • Regular expressions (PCRE) with backreferences in the target ($1, $2...)
  • Its own indexed DB table — the lookup doesn’t hurt performance even on high-traffic sites
  • Connected to the Monitor 404 module — create a redirect straight from a detected 404 in a couple of clicks

How it works

The check runs on `template_redirect`, i.e. after core’s own redirect (`redirect_canonical`) but before the 404 page renders. An exact match is tried first, then regular expression rules.

For regex rules, `preg_match()` verifies the match and `preg_replace()` resolves the backreferences in the target directly — so a rule like `^/novinky/(.+)$` → `/aktuality/$1` redirects `/novinky/nazev-clanku` to `/aktuality/nazev-clanku` with no manual substitution code needed.

Compared to alternatives

An alternative to Redirection or Safe Redirect Manager for sites that just need a simple rules table without extra unnecessary logging.

Frequently asked questions

Does it support backreferences in regex rules?
Yes — you can use $1, $2 etc. in the target to reference captured groups from the source pattern.
Will this slow down page loads?
No — rules are looked up via a dedicated indexed DB table, not options or slow scanning.
Can it find which old URLs are missing on my site?
That’s handled by the Monitor 404 module — Redirects can prefill the source field straight from a detected 404.