Skip to content

Writing redirects directly into a site’s theme code

VIP helper functions for broader redirects:

  • vip_regex_redirects() — Advanced 301 redirects using regex to match and redirect URLs.
    Caution: Regex is expensive and using this helper function will cause regex operations to be run on every uncached page load.
  • vip_substr_redirects() — Wildcard redirects based on the beginning of the request path. This is an alternative to vip_regex_redirects() for when only a redirect from /foo/bar/* to somewhere else is needed.

Last updated: December 23, 2023

Relevant to

  • WordPress